Part Number Hot Search : 
IS161 APM2306 TEA5551T TPC6108 SX02TSRP TEA1401 ATS01 25ETT
Product Description
Full Text Search
 

To Download TMC5031 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  power driver for stepper motors integrated circuits trinamic motion control gmbh & co. kg hamburg, germany tmc50 31 data sheet b lock d iagram f eatures and b enefits 2 - phase stepper motors drive capability up to 2 x 1.1a coil current motion controller with sixpoint ? ramp voltage range 4.75 16v dc spi interface 2x ref. - switch input per axis highest resolution 256 microsteps per full step full protection & diagnostics stallguard 2? h igh precision sensorless motor load detection coolstep? load dependent current sav es up to 75% energy spreadcycle? high - precision chopper for best current sine wave form and zero crossing with additional chopsync 2 ? compact size 7x7mm qfn48 package a pplications cctv, security antenna positioning heliostat controller battery powered applications office automation atm, cash recycler , pos lab automation liquid handling medical printer and scanner pumps and valves d escription the tmc5 031 is a low cost motion controller and driver ic for up to two stepper motors. it combines two flexible ramp motion controllers with energy efficient stepper motor drivers. the driver s support two - phase stepper motors and offer an industry - leading feature set, i ncluding high - resolution microstepping, sensorless mechanical load measurement, load - adaptive power opti mi - zation, and lo w - resonance chopper operation. all features are controlled by a s tandard spi? interface. integrated protection and diagnostic features support robust and reliable operation. high integration, high energy efficiency and small form factor enable miniaturized designs with low external component count for cost - effective and highly competitive solutions. dual , cost - effective controller and driver for up to two 2 - phase bipolar stepper motors . integrated motion controller with spi interface. m o t i o n c o n t r o l l e r w i t h l i n e a r 6 p o i n t r a m p g e n e r a t o r m o t i o n c o n t r o l l e r w i t h l i n e a r 6 p o i n t r a m p g e n e r a t o r d r i v e r 1 d r i v e r 2 t m c 5 0 3 1 p r o t e c t i o n & d i a g n o s t i c s p r o g r a m m a b l e 2 5 6 s t e p s e q u e n c e r p r o g r a m m a b l e 2 5 6 s t e p s e q u e n c e r p r o t e c t i o n & d i a g n o s t i c s 2 x r e f . s w i t c h e s 2 x r e f . s w i t c h e s s p i p o w e r s u p p l y c h a r g e p u m p m o t o r 1 m o t o r 2 s t a l l g u a r d 2 c o o l s t e p
TMC5031 datasheet (rev. 1 . 11 / 201 6 - apr - 28 ) 2 www.trinamic.com application examples: high flexibility C multipurpose use the tmc 5031 score s with power density , complete motion controlling features and integrated power stages . it offers a versatility that covers a wide spectrum of applications from battery systems up to embedded applications with 1 . 1 a current per motor . the small form factor keep s costs down and allow s for miniaturized layouts . extensive support at the chip, board, and sof tware levels enables rapid design cycles and fast time - to - market with competitive products. high energy efficiency and reliability from trinamics coolstep techno logy deliver cost savings in related systems such as power supplies and cooling. o rder c odes order code description size [ mm 2 ] tmc 5031 - la dual stallguard2? and coolstep ? controller/driver, qf n 48 7 x 7 TMC5031 - eval evaluation board for TMC5031 85 x 55 two reference switch inputs can be used for each motor. a single cpu controls the whole system, which is highly economical and space saving. tmc50 31 - eval e valuation b oard e valuati on & development platform the tmc50 31 - eval is a tiny evaluation board, combining the TMC5031 with its basic external components and a 32 bit microcontroller interfacing to a pc. the firmware source code is available from the trinamic website to allow own m odifications and to make design - in easy. m m c p u t m c 5 0 3 1 h i g h - l e v e l i n t e r f a c e s p i m i n i a t u r i z e d d e s i g n f o r u p t o t w o s t e p p e r m o t o r s m c p u t m c 5 0 3 1 h i g h - l e v e l i n t e r f a c e s p i r e f . s w i t c h e s r e f . s w i t c h e s r e f . s w i t c h e s
TMC5031 datasheet (rev. 1 . 11 / 201 6 - apr - 28 ) 3 www.trinamic.com t able of c ontents 1 principles of operat ion 4 1.1 k ey c oncepts 4 1.2 spi c ontrol i nterface 5 1.3 s oftware 5 1.4 m oving and c ontrolling the m otor 5 1.5 p recision d river with p rogrammable m icrostepping w ave 5 1.6 stall g uard 2 C m echanical l oad s ensing 5 1.7 cool s tep C l oad a daptive c urrent c ontrol 6 2 pin assignments 7 2.1 p ackage o utline 7 2.2 s ignal d escriptions 7 3 sample circuits 10 3.1 s tandard a pplication c ircuit 10 3.2 5 v o nly s upply 12 3.3 e xternal vcc s upply 13 3.4 o ptimizing a nalog p recision 14 3.5 d river p rotection and eme c ircuitry 15 4 spi interface 16 4.1 spi d atagram s tructure 1 6 4.2 spi s ignals 17 4.3 t iming 18 5 register mapping 19 5.1 g eneral c onfiguration r egisters 20 5.2 r amp g enerator r egisters 21 5.3 m otor d river r egisters 26 6 current setting 32 6.1 s ense r esistors 33 7 chopper operation 34 7.1 spread c ycle c hopper 35 7.2 c lassic 2 - p hase m otor c onstant o ff t ime c hopper 38 7.3 r andom o ff t ime 39 7.4 chop s ync 2 for q uiet m otors 40 8 driver diagnostic fl ags 41 8.1 t emperature m easurement 41 8.2 s hort to gnd p rotection 41 8.3 o pen l oad d iagnostics 41 9 ramp generator 42 9.1 r eal w orld u nit c onversion 42 9.2 m otion p rofiles 43 9.3 i nterrupt h andling 44 9.4 v elocity t hresholds 44 9.5 r eference s witches 46 9.6 r estrictions of r amp g enerator (e rrata ) 47 10 stallguard2 load mea surement 50 10.1 t uning the stall g uard 2 t hreshold sgt 51 10.2 stall g uard 2 u pdate r ate and f ilter 53 10.3 d etecting a m otor s tall 53 10.4 h oming with stall g uard 53 10.5 l imits of stall g uard 2 o peration 53 11 coolstep operation 54 11.1 u ser b enefits 54 11.2 s etting up for cool s tep 54 11.3 t uning cool s tep 56 12 sine - wave look - up table 57 12.1 u ser b enefits 57 12.2 m icrostep t able 57 13 quick configuration guide 59 14 getting started 62 14.1 i nitialization e xamples 62 15 clock oscillator and clock input 63 15.1 u sing the i nternal c lo ck 63 15.2 u sing an e xternal c lock 63 15.3 c onsiderations on the f requency 63 16 absolute maximum rat ings 65 17 electrical character istics 65 17.1 o perational r ange 65 17.2 dc c haracteristics and t iming c haracteristics 66 17.3 t hermal c haracteristics 68 18 layout considerations 69 18.1 e xposed d ie p ad 69 18.2 w iring gnd 69 18.3 s upply f iltering 69 18.4 l ayout e xample 70 19 package mechanical d ata 71 19.1 d imensional d rawings 71 19.2 p ackage c odes 71 20 disclaimer 72 21 esd sensitive device 72 22 table of figures 73 23 revision history 74 24 references 74
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 4 www.trinamic.com 1 principles of operation figure 1 . 1 basic application and block diagram the tmc 5031 motion controller and driver chip is an intelligent power component interfacing between the cpu and up to two stepper motors . all stepper motor logic is completely within the tmc 5031 . no software is required to control the motor C just provide target positions. the tmc 5031 offers a nu mber of unique enhancements which are enabled by the system - on - chip integration of driver and controller. the sixpoint ramp generator of the tmc 5031 uses coolstep and stallguard2 automatically to optimize every motor movement : trinamics special features co ntribute toward lower system cost, greater precision, greater energy efficiency, smoother motion, and cooler operation in stepper motor applications. the clear conce pt and the comprehensive solution save design - in time . 1.1 key concepts the tmc 5031 implement s several advanced features which are exclusive to trinamic products. these features contribute toward greater precision, greater energy efficiency, higher reliability, smoother motion, and cooler operation in many stepper motor applications. stallguard2 ? h igh - precision load measurement using the back emf on the motor coils . coolstep ? l oad - adaptive current control which reduces energy consumption by as much as 75% . spreadcycle ? h igh - precision chopper algorithm available as an alternative to the traditional constant off - time algorit hm . s ixpoint ? fast and precise positioning using a hardware ramp generator with a set of four acceleration / deceleration settings . quickest response due to dedicated hardware. in addition to these performance enhancements, trinam ic motor drivers also offer safeguards to detect and protect against shorted outputs, output open - circuit, overtemperature, and undervoltage conditions for enhancing safety and recovery from equipment malfunctions. h a l f b r i d g e 2 h a l f b r i d g e 1 h a l f b r i d g e 1 h a l f b r i d g e 2 + v m v s 2 x c u r r e n t c o m p a r a t o r 2 p h a s e s t e p p e r m o t o r n s s t e p p e r d r i v e r p r o t e c t i o n & d i a g n o s t i c s p r o g r a m m a b l e s i n e t a b l e 4 * 2 5 6 e n t r y 2 x d a c s t a l l g u a r d 2 ? c o o l s t e p ? x o 1 a 1 o 1 a 2 b r 1 a / b r s e n s e r s e n s e o 1 b 1 o 1 b 2 c h o p p e r v c c _ i o t m c 5 0 3 1 d u a l s t e p p e r m o t o r d r i v e r / c o n t r o l l e r s p i i n t e r f a c e c s n s c k s d o s d i 2 x l i n e a r 6 p o i n t r a m p g e n e r a t o r r e f e r e n c e s w i t c h p r o c e s s i n g s t e p & d i r e c t i o n p u l s e g e n e r a t i o n r e f l 1 s t e p p e r # 1 m o t i o n c o n t r o l c o o l s t e p m o t o r d r i v e r r e f r 1 h a l f b r i d g e 2 h a l f b r i d g e 1 h a l f b r i d g e 1 h a l f b r i d g e 2 + v m v s 2 x c u r r e n t c o m p a r a t o r 2 p h a s e s t e p p e r m o t o r n s p r o g r a m m a b l e s i n e t a b l e 4 * 2 5 6 e n t r y 2 x d a c s t a l l g u a r d 2 ? c o o l s t e p ? x o 2 a 1 o 2 a 2 b r 2 a / b r s e n s e r s e n s e o 2 b 1 o 2 b 2 c h o p p e r r e f e r e n c e s w i t c h p r o c e s s i n g s t e p & d i r e c t i o n p u l s e g e n e r a t i o n s t e p p e r # 2 c o o l s t e p m o t o r d r i v e r 2 x l i n e a r 6 p o i n t r a m p g e n e r a t o r m o t i o n c o n t r o l c o n t r o l r e g i s t e r s e t c l k o s c i l l a t o r / s e l e c t o r 5 v v o l t a g e r e g u l a t o r t e m p e r a t u r e m e a s u r e m e n t c h a r g e p u m p c p o c p i v c p 2 2 n 1 0 0 n c l k _ i n i n t e r f a c e r e f l 2 r e f r 2 + v m 5 v o u t v s a 4 . 7 + v i o i n t p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n s i n g l e d r v g n d p g n d p g n d g n d a f f f f f = 6 0 n s s p i k e f i l t e r t s t _ m o d e d i e p a d v c c r s e n s e = 0 r 2 5 a l l o w s f o r m a x i m u m c o i l c u r r e n t s p i ? o p t . e x t . c l o c k 1 2 - 1 6 m h z 3 . 3 v o r 5 v i / o v o l t a g e 1 0 0 n 1 0 0 n 1 0 0 n 1 0 0 n i n t e r r u p t o u t r e f . / s t o p s w i t c h e s m o t o r 2 r e f . / s t o p s w i t c h e s m o t o r 1 o p t . d r i v e r e n a b l e
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 5 www.trinamic.com 1.2 spi control interfac e the spi interface is a bit - serial interface synchronous to a bus clock. for every bit sent from the bus master to the bus slave, another bit is sent simultaneously from the slave to the master. communication betw een an spi master and the tmc 5031 slave always consists of se nding one 4 0 - bit command word and receiving one 4 0 - bit status word. the spi command rate typically is a few commands per complete motor motion . 1.3 software from a software point of view the tmc 5031 is a peripheral with a number of control and status registe rs. m ost of them can either be written only or read only, some of the registers allow both read and write access. in case read - modify - write access is desired for a write only register, a shadow register can be realized in master software. 1.4 moving and contr olling the motor 1.4.1 integrated motion controller the integrated 32 bit motion controller automatically drives the motors to target positions, or accelerates to target velocities. all motion parameters can be changed on the fly. the motion controller recalcula tes immediately. a minimum set of configuration data consists of acceleration and deceleration values and the maximum motion velocity. a start and stop velocity is supported as well as a second acceleration and deceleration setting. the integrated motion c ontroller supports immediate reaction to mechanical reference switches and to the sensorless stall detection stallguard 2. b enefits are: - flexible ramp programming - efficient use of motor torque for acceleration and deceleration a llows higher machine through put - immediate reacti on to stop and stall conditions 1.5 precision driver with programmable microstepping wave current into the motor coils is controlled using a cycle - by - cycle chopper mode. two chopper modes are available: a traditional constant off - time mode and the new spreadcycle mode. constant off - time mode provides higher torque at the highest velocity, while spreadcycle mode offers smoother operation and greater power efficiency over a wide range of speed and load. the spreadcycle chopper scheme automati cally integrates a fast decay cycle and guarantees smooth zero crossing performance. programmable microstep shapes allow optimizing the motor performance. benefits are: - significantly improved microstepping with low cost motors - motor runs smooth and quiet - reduced mechanical resonances yields improved torque 1.6 stallguard 2 C mechanical load sensing stallguard2 provides an accurate measurement of the load on the motor. it can be used for stall detection as well as other uses at loads below those which stall th e motor, such as coolstep load - adaptive current reduction. this gives more information on the drive allowing functions like sensorless homing and diagnostics of the drive mechanics.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 6 www.trinamic.com 1.7 coolstep C load adaptive current control coolstep drives the motor at the optimum current. it uses the stallguard 2 load measurement information to adjust the motor current to the minimum amount required in the actual load situation. this saves energy and keeps the components cool, making the drive an efficient and precise so lution. benefits are: - energy efficiency power consumption decreased up to 75% - motor generates less heat improved mechanical precision - less or no cooling improved reliability - use of smaller motor less torque reserve required cheaper motor does the job figure 1 . 2 shows the efficiency gain of a 42mm stepper motor when using coolstep compared to standard operation with 50% of torque reserve. coolstep is enabled above 60rpm in the example. figure 1 . 2 energy efficiency with coolstep (example) 0 0 , 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 e f f i c i e n c y v e l o c i t y [ r p m ] e f f i c i e n c y w i t h c o o l s t e p e f f i c i e n c y w i t h 5 0 % t o r q u e r e s e r v e
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 7 www.trinamic.com 2 pin assignments 2.1 package outline figure 2 . 1 tmc 5031 pin assignments. 2.2 sign al descriptions pin number type function gnd 6, 9, 10, 12, 24, 34 gnd digital ground pin for io pins and digital circuitry. vcc_io 7 3.3v or 5v i/o supply voltage pin for all digital pin s. vsa 30 analog supply voltage for 5v regulator C typically sup plied with driver supply voltage. an additional 100nf capacitor to gnd (gnd plane) is recommended for best performance. gnda 31 gnd analog gnd 5vout 32 output of internal 5v regulator. attach 2.2 f or larger ceramic capacitor to gnda near to pin for best performance. may be used to supply vcc of chip. t m c 5 0 3 1 - l a q f n 4 8 7 m m x 7 m m 0 . 5 p i t c h r e f l 1 c p o g n d p t s t _ m o d e o 1 a 1 v s o 1 b 1 b r 1 a o 1 a 2 v s o 1 b 2 v c c _ i o p p o 2 a 2 b r 2 a b r 2 b v s o 2 b 2 v s o 2 b 1 1 i n t s d o g n d g n d s d i s c k c s n r e f r 1 r e f l 2 v s a g n d a g n d c p i c l k g n d g n d p r e f r 2 b r 1 b o 2 a 1 2 3 4 5 6 7 8 9 1 0 1 1 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 3 6 3 5 3 4 3 3 3 2 3 1 3 0 2 9 2 8 2 7 2 6 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 3 9 3 8 d r v _ e n n v c p 3 7 2 5 - 1 3 1 2 - g n d - v c c g n d 5 v o u t
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 8 www.trinamic.com pin number type function vcc 33 5v supply input for digital circuitry within chip and charge pump. attach 470nf capacitor to gnd (gnd plane). may be supplied by 5vout. a 2 .2? resistor is recommended for decoupling noise from 5vout. when using an external supply, make sure, that vcc comes up before or in parallel to 5vout. die_pad - gnd connect the exposed die pad to a gnd plane. provide as many as possible vias for heat tr ansfer to gnd plane. t able 2 . 1 low voltage digital and analog power supply pins pin number type function cpo 35 o(vcc) charge pump driver output. outputs 5v (gnd to vcc) square wave with 1/16 of internal os cillator frequency. cpi 36 i(vcp) charge pump capacitor input: provide external 22 nf / 50 v capacitor to cpo. vcp 37 output of charge pump. provide external 100 nf capacitor to vs. t able 2 . 2 charge pump pins pin number type function int 1 o (z) tristate interrupt output . can be progra mmed to provide interrupt output based on ramp generator flags ramp_stat bits 4, 5, 6 & 7 ( poscmp_enable =1 ). pp 2 o (z) tristate position compare output for motor 1 ( poscmp_enable =1 ). csn 3 i chip select input of spi interface sck 4 i serial clock input of spi interface sdi 5 i data input of spi interface sdo 8 o (z) tristate d ata output of spi interface ( enabled with csn=0) clk 11 i clock input . tie to gnd using short wire for internal clock or supply external clock . the first high signal disables th e internal oscillator until power down. refr2 25 i right reference switch input for motor 2 refl2 26 i left reference switch input for motor 2 refr1 27 i right reference switch input for motor 1 refl1 28 i left reference switch input for motor 1 drv_e nn 29 i enable i nput for motor drivers. the power stage becomes switched off (all motor outputs floating) when this pin becomes driven to a high level . tie to gnd for normal operation. tst_mode 48 i test mode input. puts ic into test mode. tie to gnd for normal operation. - 13, 23, 38 n.c. unused pins C no internal electrical connection. leave open or tie to gnd for compatibility with future devices. t able 2 . 3 digital i/o pins (all related to vcc_io supply)
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 9 www.trinamic.com pin number type function o2a1 14 o (vs) motor 2 coil a output 1 br2a 15 sense resistor connection for m otor 2 coil a . place sense resistor to gnd near pin . o2a2 16 o (vs) motor 2 coil a output 2 vs 17, 19 motor supply voltage. provide filtering ca pacity near pin with shortest loop to nearest gndp pin (respectively via gnd plane). gndp 18 gnd power gnd. connect to gnd plane near pin. o2b1 20 o (vs) motor 2 coil b output 1 br2b 21 sense resistor connection for m otor 2 coil b. place sense resistor to gnd near pin . o2b2 22 o (vs) motor 2 coil b output 2 o1b2 39 o (vs) motor 1 coil b output 2 br1b 40 sense resistor connection for m otor 1 coil b. place sense resistor to gnd near pin . o1b1 41 o (vs) motor 1 coil b output 1 vs 42, 44 motor supply voltage. provide filtering capacity near pin with shortest loop to nearest gndp pin (respectively via gnd plane). gndp 43 gnd power gnd. connect to gnd plane near pin. o1a2 45 o (vs) motor 1 coil a output 2 br1a 46 sense resistor connection for m otor 1 coil a . place sense resistor to gnd near pin . o1a1 47 o (vs) motor 1 coil a output 1 t able 2 . 4 power driver pins
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 10 www.trinamic.com 3 sample circuits the sample circuits show the connection of the external components in diff erent operation and supply modes. the connection of the bus interface and further digital signals is left out for clarity. 3.1 standard application circuit figure 3 . 1 standard applic ation circuit the standard application circuit uses a minimum set of additional components in order to operate the motor. use low esr capacitors for filtering the power supply capable to cope with the current ripple. the current ripple often depends on th e power supply and cable length. the vcc_io voltage can be supplied from 5vout, or from a fast startup 3.3v regulator. in order to minimize linear voltage regulator power dissipation of the internal 5v voltage regulator in applications where vm is high, a different (lower) supply voltage can be used for vsa, if available. for best motor chopper performance, an optional r/c - filter de - couples 5vout from digital noise cause by power drawn from vcc. basic layout hints place sense resistors and all filter capac itors as close as possible to the related ic pins. use a solid common gnd for all gnd connections, also for sense resistor gnd. connect 5vout filtering capacitor directly to 5vout and gnda pin. see layout hints for more details. low esr electrolytic capaci tors are recommended for vs filtering. attention in case vsa is supplied by a different voltage source, make sure that vsa does not exceed vs by more than one diode drop upon power up or power down. v c c _ i o t m c 5 0 3 1 s p i i n t e r f a c e c s n s c k s d o s d i r e f e r e n c e s w i t c h p r o c e s s i n g r e f l 1 r e f r 1 r e f e r e n c e s w i t c h p r o c e s s i n g c o n t r o l l e r 2 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n c l k _ i n r e f l 2 r e f r 2 + v m 5 v o u t v s a 4 . 7 i n t p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n g n d p g n d g n d a t s t _ m o d e d i e p a d v c c o p t i o n a l e x t e r n a l c l o c k 1 2 - 1 6 m h z * ) f o r a r e l i a b l e s t a r t - u p i t i s e s s e n t i a l t h a t v c c _ i o c o m e s u p t o a m i n i m u m o f 1 . 5 v b e f o r e t h e t m c 5 0 3 1 l e a v e s t h e r e s e t c o n d i t i o n . t h e r e f o r e , t r i n a m i c r e c o m m e n d s u s i n g a f a s t - s t a r t - u p v o l t a g e r e g u l a t o r ( e . g . t s 3 4 8 0 c x 3 3 ) i n a 3 . 3 v e n v i r o n m e n t . 1 0 0 n 1 0 0 n c o n t r o l l e r 1 f u l l b r i d g e a f u l l b r i d g e b + v m v s s t e p p e r m o t o r # 1 n s o 1 a 1 o 1 a 2 b r 1 a r s 1 b o 1 b 1 o 1 b 2 d r i v e r 1 1 0 0 n b r 1 b r s 1 a f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r # 2 n s o 2 a 1 o 2 a 2 b r 2 a r s 2 b o 2 b 1 o 2 b 2 d r i v e r 2 b r 2 b r s 2 a v s 1 0 0 n + v m 1 0 0 f c p i c p o t s 3 4 8 0 c x 3 3 * ) 3 . 3 v 5 v
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 11 www.trinamic.com 3.1.1 vcc_io requirements for a reliable start - up it is ess ential that vcc_io comes up to a minimum of 1.5v before the tmc 5031 leaves the reset condition . the reset condition ends earliest 50s after the time when vsa exceeds its undervoltage threshold of typically 4.2v , or when 5vout exceeds its undervoltage thre shold of typically 3.5v, whichever comes last . t here are three ways to come up to vcc_io requirements - 5vout can be used directly to supply vcc_io. in this case there are no further requirements. - an external low drop regulator can be used in a 3.3v envir onment as shown in figure 3 . 1 . n ote, that most voltage regulators are not suitable for this application because they show a delayed boot up . the following external regulators are proved by trinamic: ts3480cx33 this regulator can be used within the full supply voltage range when tied to the motor supply voltage. ld1117 - 3.3 this regulator can be used to supply vcc_io from 5vout, or from a supply voltage of up to 15v. - vcc_io can be supplied externally as shown in figure 3 . 2 . in this case it is mandatory to connect the schottky diode to the logic supply of the external circuitry. please note, that the 2k resistor is not to be used with 5v i/o voltage. figure 3 . 2 external supply of vcc_io (showing optional filtering for vcc) refer to application note no. 028 supply voltage considerations: vcc_io in tmc50xx designs (www.trinamic.com). here you will fi nd complete information about connecting vcc_io. 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n c p i c p o v c c _ i o 2 r 2 2 2 n + v c c _ i o m s s 1 p 3 1 k 2 k 3 . 3 v , o n l y
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 12 www.trinamic.com 3.2 5 v only supply f igure 3 . 3 5v only operation while the standard application circuit is limited to roughly 5.5 v lower supp ly voltage, a 5 v only application lets the ic run from a normal 5 v +/ - 5 % supply. in this application, linear regulator drop must be minimized. therefore, the major 5 v load is removed by supplying vcc directly from the external supply. in order to keep supply ripple away from the analog voltage reference, 5vout should have an own filtering capacity and the 5vout pin does not become bridged to the 5v supply. v c c _ i o t m c 5 0 3 1 s p i i n t e r f a c e c s n s c k s d o s d i r e f e r e n c e s w i t c h p r o c e s s i n g r e f l 1 r e f r 1 r e f e r e n c e s w i t c h p r o c e s s i n g c o n t r o l l e r 2 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n c l k _ i n r e f l 2 r e f r 2 + 5 v 5 v o u t v s a 4 . 7 i n t p p i n t & p o s i t i o n p u l s e o u t p u t d r v _ e n n d r v _ e n n g n d p g n d g n d a t s t _ m o d e d i e p a d v c c o p t i o n a l e x t e r n a l c l o c k 1 2 - 1 6 m h z 1 0 0 n 4 7 0 n c o n t r o l l e r 1 f u l l b r i d g e a f u l l b r i d g e b + 5 v v s s t e p p e r m o t o r # 1 n s o 1 a 1 o 1 a 2 b r 1 a r s 1 b o 1 b 1 o 1 b 2 d r i v e r 1 1 0 0 n b r 1 b r s 1 a f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r # 2 n s o 2 a 1 o 2 a 2 b r 2 a r s 2 b o 2 b 1 o 2 b 2 d r i v e r 2 b r 2 b r s 2 a v s 1 0 0 n + 5 v 1 0 0 f c p i c p o v c c _ i o 5 v v c c _ i o 3 . 3 v s e e s t a n d a r d a p p l i c a t i o n s c h e m a t i c
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 13 www.trinamic.com 3.3 external vcc supply supplying vcc from an external supply is advised, when cooling of the chip i s critical, e.g. at high environment temperatures in combination with high supply voltages ( 16 v), as the linear regulator is a major source of on - chip power dissipation. it must be made sure that the external vcc supply comes up before or synchronously with the 5vout supply, because otherwise the power - up reset event may be missed by the tmc 5031 . a diode from 5vout to vcc ensures this, in case the external voltage regulator is not a low drop type linear regulator. in order to prevent overload of the internal 5v regulator when using this diode, an additional series resistor has been added to vsa. an alternative for reduced power dissipation is using a lower supply voltage for vsa, e.g. 6v to 12v. if power dissipation is critical, but no external supply is available, the clock frequency can be reduced as a first step by supplying external 12 mhz clock . f igure 3 . 4 using an external 5v supply to reduce linear regulator power dissipation 3.3.1 internal regulator bridged in case a clean external 5v supply is available, it ca n be used for complete supply of analog and digital part ( figure 3 . 5 ). the c ircuit will benefit from a well - regulated supply, e.g. when using a +/ - 1% regulator. a precise supply guarantees increased motor current precision, becaus e the voltage at 5vout directly is the reference voltage for all internal units of the driver, especially for motor current control. for best performance, the power supply should have low ripple to give a precise and stable supply at 5vout pin with remaini ng ripple well below 5mv. some switching regulators have a higher remaining ripple, or different loads on the supply may cause lower frequency ripple. in this case, increase capacity attached to 5vout. in case the external supply voltage has poor stability or low frequency ripple, this would affect the precision of the motor current regulation as well as add chopper noise. figure 3 . 5 using an external 5v supply to bypass internal regulator the diode is mandatory to satisfy power - up conditions! 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n + 5 v c p i c p o 2 2 0 r l l 4 1 4 8 5 v v o l t a g e r e g u l a t o r + 5 v 5 v o u t v s a 4 . 7 v c c 4 7 0 n 1 0 r w e l l - r e g u l a t e d , s t a b l e s u p p l y , b e t t e r t h a n + - 5 %
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 14 www.trinamic.com 3.4 optimizing analog precision the 5vout pin is used as an analog reference for operation of the tmc 5031 . performance will degrade when there is voltage ripple on this pin. most of the high frequency ripple in a tmc 5031 design results from the oper ation of the internal digital log ic. the digital logic switches wit h each edge of the clock signal. further, ripple results from operation of the charge pump, which operates with roughly 1 mhz and draws current from the vcc pin. in order to keep this ripple as low as possible, an additional filtering capacitor can be put directly next to the vcc pin with vias to the gnd plane giving a short connection to the digital gnd pins (pin 6 and pin 34). analog performance is best, when this ripple is kept away from the analog supply pin 5vout, using an additional series resistor of 2.2 ? to 3.3 ? . the voltage drop on this resistor will be roughly 100 mv (i vcc * r). f igur e 3 . 6 adding an rc - filter on vcc for reduced ripple 5 v v o l t a g e r e g u l a t o r c h a r g e p u m p v c p 2 2 n 1 0 0 n + v m 5 v o u t v s a 4 . 7 v c c 1 0 0 n 4 7 0 n c p i c p o g n d a 2 r 2
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 15 www.trinamic.com 3.5 driver protection and eme circuitry some applications have to cope with esd events caused by motor operation or external influence. despite esd circuitry within the driver chips, esd events occurring during operation can cause a reset or even a destruction of the motor driver, depending on their energy. especially plastic housings and belt drive systems tend to cause esd events. it is best practice to avoid esd events by attaching all conductive parts, especially the motors themselves to pcb ground, or to apply electrically conductive plastic parts. in addition, the driver can be protected up to a certain degree against esd events or live plugging / pulling the motor, which also causes high voltages and high currents into the motor connector terminals. a simple scheme uses capacitors at the driver outputs to reduce the dv/dt caused by esd events. larger capacitors will bring more benefit concerning esd suppre ssion, but cause additional current flow in each chopper cycle, and thus increase driver power dissipation, especially at high supply voltages. the values shown are example values C they might be varied between 100pf and 1nf. the capacitors also dampen hig h frequency noise injected from digital parts of the circuit and thus reduce electromagnetic emission. a more elaborate scheme uses lc filters to de - couple the driver outputs from the motor connector. varistors in between of the coil terminals eliminate co il overvoltage caused by live plugging. optionally protect all outputs by a varistor against esd voltage . figure 3 . 7 simple esd enhancement and more elaborate motor output protec tion f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r n s o a 1 o a 2 o b 1 o b 2 d r i v e r 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v f u l l b r i d g e a f u l l b r i d g e b s t e p p e r m o t o r n s o a 1 o a 2 o b 1 o b 2 d r i v e r 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z 5 0 o h m @ 1 0 0 m h z v 1 v 2 f i t v a r i s t o r s t o s u p p l y v o l t a g e r a t i n g . s m d i n d u c t i v i t i e s c o n d u c t f u l l m o t o r c o i l c u r r e n t . 4 7 0 p f 1 0 0 v 4 7 0 p f 1 0 0 v v a r i s t o r s v 1 a n d v 2 p r o t e c t a g a i n s t i n d u c t i v e m o t o r c o i l o v e r v o l t a g e . v 1 a , v 1 b , v 2 a , v 2 b : o p t i o n a l p o s i t i o n f o r v a r i s t o r s i n c a s e o f h e a v y e s d e v e n t s . b r b r s a b r a 1 0 0 n f 1 6 v r s b 1 0 0 n f 1 6 v v 1 a v 1 b v 2 a v 2 b
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 16 www.trinamic.com 4 spi interface 4.1 spi datagram structure the tmc 5031 uses 40 bit spi ? (serial peripheral interface, spi is trademark of motorola) datagrams for communication with a microcontroller. microcontrollers which are equipped with hardware spi are typically ab le to communicate using integer multiples of 8 bit. the ncs line of the tmc 5031 must be handled in a way, that it stays active (low) for the complete duration of the datagram transmission. each datagram sent to the tmc 5031 is composed of an address byte f ollowed by four data bytes. this allows direct 32 bit data word communication with the register set of the tmc 5031 . each register is accessed via 32 data bits even if it uses less than 32 data bits. for simplification, each register is specified by a one byte address: - for a read access the most significant bit of the address byte is 0 . - for a write access the most signific ant bit of the address byte is 1 . most registers are write only registers, some can be read additionally, and there are also some rea d only registers. 4.1.1 selection of write / read (write_notread) the read and write selection is controlled by the msb of the address byte (bit 39 of the spi datagram). this bit is 0 for read access and 1 for write access. so, the bit named w is a wr ite_notread control bit. the active high write bit is the msb of the address byte. so, 0x80 has to be added to the address for a write access. the spi interface always delivers data back to the master, independent of the w bit. the data transferred back is the data read from the address which was transmitted with the previous datagram, if the previous access was a read access. if the previous access was a write access, then the data read back mirrors the previously received write data. so, the difference be tween a read and a write access is that the read access does not transfer data to the addressed register but it transfers the address only and its 32 data bits are dummies, and, further the following read or write access delivers back the data read from th e address transmitted in the preceding read cycle. a read access request datagram uses dummy write data. read data is transferred back to the master with the subsequent read or write access. hence, reading multiple registers can be done in a pipelined fas hion . whenever data is read from or written to the tmc 5031 , the msbs delivered back contain the spi status, spi_status , a number of eight selected status bits. tmc 5031 spi d atagram s tructure msb (transmitted first) 40 bit lsb (transmitted last) 39 ... ... 0 ? 8 bit address ? 8 bit spi status ? ? 32 bit data 39 ... 32 31 ... 0 ? to tmc 5031 : rw + 7 bit address ? from tmc 5031 : 8 bit spi sta tus 8 bit data 8 bit data 8 bit data 8 bit data 39 / 38 ... 32 31 ... 24 23 ... 16 15 ... 8 7 ... 0 w 38...32 31...28 27...24 23...20 19...16 15...12 11...8 7...4 3...0 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 9 8 7 6 5 4 3 2 1 0
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 17 www.trinamic.com example : for a read access to the register ( xactual ) with the address 0x2 1, the a ddress byte has to be set to 0x2 1 in the access preceding the read access. for a write access to the register ( vmax ), the address byte has to be set to 0x80 + 0x2 7 = 0xa 7 . for read access, the data bit might have any value ( - ). so, one can set them to 0 . action data sent to tmc 5031 data received from tmc 5031 read xactual ? 0x2100000000 ? 0xss & unused data read xactual ? 0x2100000000 ? 0xss & xactual write v max := 0x00abcdef ? 0xa7 00abcdef ? 0xss & xactual write v max := 0x00123456 ? 0xa7 00123456 ? 0xss00abcdef *)s: is a placeholder for the status bits spi_status 4.1.2 spi status bits transferred with each d atag ram read b ack new status information becomes latched at the end of each access and is available with the next spi transfer. spi_status C status flags transmitted wit h each spi access in bits 39 to 32 bit name comment 7 - reserved (0) 6 status_stop_l(2) ramp_stat2 [0] C status_stop_l(1) ramp_stat1 [0] C velocity_reached(2) ramp _stat2 [8] C velocity_reached(1) ramp_stat1 [8] C driver_error(2) gstat [2] C gstat ) 1 driver_erro r(1) gstat [1] C gstat ) 0 reset_flag gstat [ 0 ] C gstat ) 4.1.3 data alignment all data are right aligned. some registers represent unsigned (positive) val ues, some represent integer values (signed) as twos complement numbers, single bits or groups of bits are represented as single bits respectively as integer groups. 4.2 spi signals the spi bus on the tmc 5031 has four signals: - sck C bus clock input - sdi C se rial data input - sdo C serial data output - csn C chip select input (active low) the slave is enabled for an spi transaction by a low on the chip select input csn. bit transfer is synchronous to the bus clock sck, with the slave latching the data from sdi on the rising edge of sck and driving data to sdo following the falling edge. the most significant bit is sent first. a minimum of 40 sck clock cycles is required for a bus transaction with the tmc 5031 . if more than 40 clocks are driven, the additional bits shifted into sdi are shifted out on sdo after a 40 - clock delay through an internal shift register. this can be used for daisy chaining multiple chips. csn must be low during the whole bus transaction. when csn goes high, the contents of the internal shif t register are latched into the internal control register and recognized as a command from the master to the slave. if more than 40 bits are sent, only the last 40 bits received before the rising edge of csn are recognized as the command.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 18 www.trinamic.com 4.3 timing the spi interface is synchronized to the internal system clock, which limits the spi bus clock sck to half of the system clock frequency. if the system clock is based on the on - chip oscillator, an additional 10% safety margin must be used to ensure reliable data transmission. all spi inputs as well as the enn input are internally filtered to avoid triggering on pulses shorter than 20ns. f igure 4 . 1 shows the timing parameters of an spi bus transaction, and the table below specifies their v alues. f igure 4 . 1 spi timing hint usually this spi timing is referred to as spi mode 3 (cpol=1 and cpha=1 ). spi interface timing ac - characteristics clock period: t clk parameter symbol conditions m in typ max unit sck valid before or after change of csn t cc 10 ns csn high time t csh *) min time is for syn chronous clk with sck high one t ch before csn high only t clk *) >2t clk +10 ns sck low time t cl *) min time is for syn chronous clk only t clk *) >t clk +10 ns sck high time t ch *) min time is for syn chronous clk only t clk *) >t clk +10 ns sck frequency using internal clock f sck assumes minimum osc frequency 4 mhz sck frequency using external 16mhz clock f sck assumes synchronous clk 8 mhz sdi setup time before rising edge of sck t du 10 ns sdi hold time after rising edge of sck t dh 10 ns data out valid time after falling sck clock edge t do no capacitive load on sdo t filt +5 ns sdi, sck and csn filter delay time t filt rising and falling edge 12 20 30 ns c s n s c k s d i s d o t c c t c c t c l t c h b i t 3 9 b i t 3 8 b i t 0 b i t 3 9 b i t 3 8 b i t 0 t d o t z c t d u t d h t c h
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 19 www.trinamic.com 5 register mapping this chapter gives an overview of the complete register set. some of the registers bundling a number of single bits are detailed in extra tables. the functional practical application of the settings is detailed in ded icated chapters. note - all registers become reset to 0 upon power up, unless otherwise noted. - add 0x80 to the address addr for write accesses! n otation of hexadecim al and binary number s 0x precedes a hexadecimal number, e.g. 0x04 % precedes a mult i - bit binary number, e.g. %100 n otation of r/w field r read only w write only r/w read - and writable register r+c clear upon read (i.e. status bit becomes reset after readout) o verview r egister m apping r egister d escription general configuration r e gisters these registers contain - global configuration - global status flags ramp generator m otion control register s et this register set offers registers for - choosing a ramp mode - choosing velocities - homing - acceleration and deceleration - target positioni ng ramp generator driver feature control register s et this register set offers registers for - driver current control - setting th resholds for coolstep operation - setting thresho lds for different chopper modes - a reference switch and stallguard2 event configuratio n - a ramp and re ference switch status register motor driver register s et this register set offers registers for - setting / reading out microstep table and counter - c hopper and driver configuration - coolstep and stallguard2 configuration - reading out stallguar d2 values and driver error flags
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 20 www.trinamic.com 5.1 general configuration registers g eneral configuration registers (0 x 000 x 1f) r/w addr n register description / bit names rw 0x00 11 gconf bit gconf C global configuration flags 0 ..2 reserved , set to 0 3 pos cmp_enable 0: out puts int and pp are tristated. 1: position compare pulse (pp) and interrupt output (int) are available attention C do not leave the ou t put s floating in tristate condition, provide an external pull - up or set this bit 1. 4 ..6 reserv ed, set to 0 7 test_mode 0: normal operation 1: enable analog test output on pin refr2 test_sel selects the function of refr2: 04: t120, dac1, vddh1, dac2, vddh2 attention: not for user, set to 0 for normal operation! 8 shaft1 1: inverse mo tor 1 direction 9 shaft2 1: inverse motor 2 direction 10 lock_gconf 1: gconf is locked against further write access. r+c 0x01 4 gstat bit gstat C global status flags 0 reset 1: indicates that the ic has been reset since the last read access to gstat. 1 drv_err1 1: indicates, that driver 1 has been shut down due to overtemperature or short circuit detection since the last read access. read drv_status1 for details. the flag can only be reset when all error conditions are cleared. 2 drv_err2 1: indicates, that driver 2 has been shut down due to overtemperature or short circuit detection since the last read access. read drv_status2 for details. the flag can only be reset when all error conditions are cleared. 3 uv_cp 1: indica tes an undervoltage on the charge pump. the driver is disabled in this case. w 0x03 4 test_sel bit slaveconf 3..0 test_sel : selects the function of refr2 in test mode : 04: t120, dac1, vddh1, dac2, vddh2 attention: not for user, set to 0 for norma l operation! r 0x04 8 + 8 input bit input 0 ..6 unused, ignore these bits 7 reads the state of the drv_enn pin 31.. 24 version : 0x01=first version of the ic identical numbers mean full digital compatibility.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 21 www.trinamic.com g eneral configuration registers (0 x 000 x 1f) r/w addr n register description / bit names w 0x05 32 x_compare position com parison register for motor 1 position strobe. activate poscmp_enable to get position pulse on output pp. xactual = x_compare : - output pp becomes high. it returns to a low state, if the positions mismatch. 5.2 ramp generator registers addresses addr are spec ified for motor 1 (upper value) and motor 2 (second address). 5.2.1 ramp generator motion control register set r amp generator motion control register set (m otor 1: 0 x 200 x 2d, m otor 2: 0 x 400 x 4d) r/w addr n register description / bit names range [unit] rw 0x2 0 0x40 2 rampmode rampmode: 0: positioning mode (using all a, d and v parameters) 1: velocity mode to positive vmax (using amax acceleration) 2: velocity mode to negative vmax (using amax acceleration) 3: hold mode (velocity remains unchanged, unless stop event occurs) 03 rw 0x21 0x41 32 xactual actual motor position (signed) hint: this value normally should only be modified, when homing the drive. in positioning mode, modifying the register content will start a motion. - 2^31 +(2^31) - 1 r 0x22 0x42 24 v actual actual motor velocity from ramp generator (signed) the sign matches the motion direction. a negative sign means motion to lower xactual. + - (2^23) - 1 [steps / t] w 0x23 0x43 18 vstart motor start velocity (unsigned) set vstop vstart! 0(2^18) - 1 [steps / t] w 0x24 0x44 16 a1 first acceleration between vstart and v1 (unsigned) 0(2^16) - 1 [steps / ta2] w 0x25 0x45 20 v1 first acceleration / deceleration phase target velocity (unsigned) 0: disables a1 and d1 phase, use amax , d max only 0(2^20) - 1 [steps / t] w 0x26 0x46 16 amax second acceleration between v1 and vmax (unsigned) this is the acceleration and deceleration value for velocity mode. 0(2^16) - 1 [steps / ta2]
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 22 www.trinamic.com r amp generator motion control register set (m otor 1: 0 x 200 x 2d, m otor 2: 0 x 400 x 4d) r/w addr n register description / bit names range [unit] w 0x27 0x47 23 vmax motion ramp target velocity (for p ositioning ensure vmax vstart ) (unsigned) this is the target velocity in velocity mode. it can be changed any time during a motion. 0(2^23) dmax deceleration between vmax and v1 (unsigned) 0(2^16) d1 decelera tion between v1 and vstop (unsigned) attention: do not set 0 in positioning mode, even if v1=0! 1(2^16) vstop motor stop velocity (unsigned) attention: set vstop vstart! attention: do not set 0 in positioning mode! 1 (2^18) tzerowait waiting time after ramping down to zero velocity before next movement or direction inversion can start and before motor power down starts. time range is about 0 to 2 seconds. this setting avoids excess acce leration e.g. from vstop to - vstart . 0(2^16) clk rw 0x2d 0x4d 32 xtarget target position for ramp mode (signed). write a new target position to this register in order to activate the ramp generator positioning in rampmode =0. initialize all veloc ity, acceleration and deceleration parameters before. hint: the position is allowed to wrap around, thus, xtarget value optionally can be treated as an unsigned number. hint: the maximum possible displacement is +/ - ((2^31) - 1). hint: when increasing v1, d1 or dmax during a motion, rewrite xtarget afterwards in order to trigger a second acceleration phase, if desired. - 2^31
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 23 www.trinamic.com 5.2.2 ramp generator driver feature control register set r amp generator driver feature control regi ster set (m otor 1: 0 x 300 x 36, m otor 2: 0 x 500 x 56) r/w addr n register description / bit names w 0x30 0x50 5 + 5 + 4 ihold_irun bit ihold_irun C driver current control 4..0 ihold standstill current (0=1/3231=32/32) 12..8 irun motor run current (0=1/3231=32/32) hint: choose sense resistors in a way, that normal irun is 16 to 31 for best microstep performance. 19..16 iholddelay controls the number of clock cycles for motor power down after a motion as soon as t zerowait has expired. the smooth transition avoids a m otor jerk upon power down. 0: instant power down 1.. 15: delay per current reduction step in multiple of 2^18 clocks w 0x31 0x51 23 vcoolthrs this is the lower threshold velocity for switching on smart energy coolstep. (unsigned) set this parameter to disable coolstep at low speeds, where it cannot work reliably. vhigh | vact | vcoolthrs: - coolstep is enabled, if configured (only bits 22..8 are used for value and for comparison) w 0x32 0x52 23 vhigh this velocity setting allows velocity depend e nt switching into a different chopper mode and fullstepping to maximize to rque. (unsigned) | vact | vhigh : - coolstep is disabled (motor runs with normal current scale) - if vhighchm is set, the chopper switches to chm =1 with tfd =0 (constant off time with slow decay, only). - chopsync 2 is switched off ( sync =0) - if vhighfs is set, the motor operates in fullstep mode. (only bits 22..8 are used for value and for comparison) rw 0x34 0x54 11 sw_mode switch mode configuration s ee separate table ! r+c 0x35 0x55 14 ramp_stat ramp status and switch event status see separate table! r 0x36 0x56 32 xlatch ramp generator latch position, latches xactual upon a programmable switch event (see sw_mode ). time reference t for velocities: t = 2^24 / f clk time reference ta2 for accelerations: ta2 = 2^41 / (f clk )2
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 24 www.trinamic.com 6.2.2.1 sw_mode C reference swit ch and stallguard2 event configuration register 0 x 34, 0 x 54: sw_mode C reference switch and stall g uard 2 event configuration register bit name comment 11 en_softstop 0: hard stop 1: soft stop the soft stop mode always uses the deceleration ramp settings d max , v 1 , d1 , vstop and tzerowait for stopping the motor. a stop occurs when the velocity sign matches the reference switch position (refl for negative velocities, refr for positive velocities) and the respective switch stop function is enabled. a hard st op also uses tzerowait before the motor becomes released. attention: do not use soft stop in combination with stallguard2 . 10 sg_stop 1: enable stop by stallguard2 . disable to release motor after stop event. attention: do not enable during motor spin - up , wait until the motor velocity exceeds a certain value, where stallguard 2 delivers a stable result. 9 - reserved, set to 0 8 latch_r_inactive 1: activates latching of the position to xlatch upon an inactive going edge on the right reference switch input refr. the active level is defined by pol_stop_r . 7 latch_r_active 1: activates latching of the position to xlatch upon an active going edge on the right reference switch input refr. hint: activate latch_r_active to detect any spurious stop event by read ing status_latch_r. 6 latch_l_inactive 1: activates latching of the position to xlatch upon an inactive going edge on the left reference switch input refl. the active level is defined by pol_stop_ l. 5 latch_l_active 1: activates latching of the position to xlatch upon an active going edge on the left reference switch input refl. hint: activate latch_l_active to detect any spurious stop event by reading status_latch_l. 4 swap_lr 1: swap the left and the right reference switch input 3 pol_stop_r sets the active polarity of the right reference switch input 0=non - inverted, high active: a high level on refr stops the motor 1=inverted, low active: a low level on refr stops the motor 2 pol_stop_l sets the active polarity of the left reference switch input 0 =non - inverted, high active: a high level on refl stops the motor 1=inverted, low active: a low level on refl stops the motor 1 stop_r_enable 1: enables automatic motor stop during active right reference switch input hint: the motor restarts in case the s top switch becomes released. 0 stop_l_enable 1: enables automatic motor stop during active left reference switch input hint: the motor restarts in case the stop switch becomes released.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 25 www.trinamic.com 6.2.2.2 ramp_stat C ramp and reference switch status register 0 x 35, 0 x 55 : ramp_stat C ramp and reference s witch status registe r r/w bit name comment r 13 status_sg 1: signals an active stallguard2 input from the coolstep driver, if enabled. hint: when polling this flag, stall events may be missed C activate sg_stop to be s ure not to miss the stall event. r+c 12 second_move 1: signals that the automatic ramp requires moving back in the opposite direction, e.g. due to on - the - fly parameter change (flag is cleared upon reading) r 11 t_zerowait_ active 1: signals, that tzerowa it is active after a motor stop. during this time, the motor is in standstill. r 10 vzero 1: signals, that the actual velocity is 0. r 9 position_ reached 1: signals, that the target position is reached. this flag becomes set while xactual and xtarget m atch. r 8 velocity_ reached 1: signals, that the target velocity is reached. this flag becomes set while vactual and vmax match. r+c 7 event_pos_ reached 1: signals, that the target position has been reached ( pos ition _reached becoming active). (flag and inte rrupt condition are cleared upon reading) this bit is ored to the interrupt output signal. r+c 6 event_stop_ sg 1: signals an active stallguard2 stop event. reading the register will clear the stall condition and the motor may re - start motion, unless the motion controller has been stopped. (flag and interrupt condition are cleared upon reading) this bit is ored to the interrupt output signal. r 5 event_stop_r 1: signals an active stop right condition due to stop switch. the stop condition and the interru pt condition can be removed by setting ramp_mode to hold mode or by commanding a move to the opposite direction. in soft_stop mode, the condition will remain active until the motor has stopped motion into the direction of the stop switch. disabling the sto p switch or the stop function also clears the flag, but the motor will continue motion. this bit is ored to the interrupt output signal. 4 event_stop_l 1: signals an active stop left condition due to stop switch. the stop condition and the interrupt cond ition can be removed by setting ramp_mode to hold mode or by commanding a move to the opposite direction. in soft_stop mode, the condition will remain active until the motor has stopped motion into the direction of the stop switch. disabling the stop switc h or the stop function also clears the flag, but the motor will continue motion. this bit is ored to the interrupt output signal. r+c 3 status_latch_r 1: latch right ready (enable position latching using switch_mode settings latch_r_active or latch_r_ina ctive ) (flag is cleared upon reading) 2 status_latch_l 1: latch left ready (enable position latching using switch_mode settings latch_l_active or latch_l_inactive ) (flag is cleared upon reading) r 1 status_stop_r reference switch right status (1=acti ve) 0 status_stop_l reference switch left status (1=active)
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 26 www.trinamic.com 5.3 motor driver registers m otor driver register set (m otor 1: 0 x 600 x 6f, m otor 2: 0 x 700 x 7f) r/w addr n register description / bit names range [unit] w 0x60 0x70 32 mslut1[0] mslut2[0] micr ostep table entries 031 each bit gives the difference between microstep x and x+1 when combined with the cor res ponding mslutsel w bits: 0: w = %00: - 1 %01: +0 %10: +1 %11: +2 1: w = %00: +0 %01: +1 %10: +2 %11: +3 this is the differential coding for the first quarter of a wave. start values for cur_a and cur_b are stored for mscnt position 0 in start_sin and start_sin90_120 . ofs31, ofs30, , ofs01, ofs00 ofs255, ofs254, , ofs225, ofs224 32x 0 or 1 reset default= sine wave table w 0x61 0x6 7 0x71 0x77 7 x 32 mslut1[1...7] mslut2[1...7] microstep table entries 32255 7x 32x 0 or 1 reset default= sine wave table w 0x68 0x78 32 mslutsel1 mslutsel2 this register defines four segments within each quarter mslut wave. four 2 bit entries determ ine the meaning of a 0 and a 1 bit in the corresponding segment of mslut . see separate table! 0 < x1 < x2 < x3 reset default= sine wave table w 0x69 0x79 8 + 8 mslutstart bit 7 0: start_sin bit 23 16: start_sin90_120 start_sin gives the absolute current at m icrostep table entry 0. start_sin 90_120 gives the absolute current for microstep table entry at positions 256 . start values are transferred to the micro step registers cur_a and cur_b , when ever the reference position mscnt =0 is passed. start_sin re set default =0 start_sin90_1 20 reset default =247 r 0x6a 0x7a 10 mscnt microstep counter. indicates actual position in the microstep table for cur_a . cur_b uses an offset of 256 . hint: move to a position where mscnt is zero before re - initializing msluts tart or mslut and mslutsel . r 0x6b 0x7b 9 + 9 mscuract bit 8 0: cur_a (signed): actual microstep current for motor phase a as read from mslut (not scaled by current) bit 24 16: cur_b (signed): actual microstep current for motor phase b as read from mslut (not scaled by current) rw 0x6c 0x7c 32 chopconf chopper and driver configuration see separate table! w 0x6d 0x7d 25 coolconf coolstep smart current control register and stallguard2 configuration see separate table!
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 27 www.trinamic.com m otor driver register set (m otor 1: 0 x 600 x 6f, m otor 2: 0 x 700 x 7f) r/w addr n register description / bit names range [unit] r 0x6f 0x7f 32 drv_ statu s stallguard2 value and driver error flags see separate table! 5.3.1 mslutsel C look up table segmentation definition 0 x 68, 0 x 78: mslutsel C l ook up table segment ation definition bit name function comment 31 x3 lut segment 3 start the sine wave look up table can be divided into up to four segments using an individual step width control entry wx . the segment borders are selected by x1 , x2 and x3 . segment 0 goes from 0 to x1 - 1. segment 1 goes from x1 to x2 - 1. segment 2 goes from x2 to x3 - 1. segme nt 3 goes from x3 to 255. for defined response the values shall satisfy: 0< x1 < x2 < x3 30 29 28 27 26 25 24 23 x2 lut segment 2 start 22 21 20 19 18 17 16 15 x1 lut segment 1 start 14 13 1 2 11 10 9 8 7 w3 lut width select from ofs(x3) to ofs255 width control bit coding w0 w3 : %00: mslut entry 0, 1 select: - 1, +0 %01: mslut entry 0, 1 select: +0, +1 %10: mslut entry 0, 1 select: +1, +2 %11: mslut entry 0, 1 select: +2 , +3 6 5 w2 lut width select from ofs(x2) to ofs(x3 - 1) 4 3 w1 lut width select from ofs(x1) to ofs(x2 - 1) 2 1 w0 lut width select from ofs00 to ofs(x1 - 1) 0 ????? ( 248 ? ??? ( 2 ? ?? ? ? 1024 + ?? 1024 ) ) ? 1 m ircostep table calcu lation for a sine wa ve equivalent to the power on default : - i :[0 255] is the table index - the amplitude of the wave is 248. the resulting maximum positive value is 247 and the maximum negative value is - 248. - the round function rounds values from 0.5 to 1.49 99 to 1
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 28 www.trinamic.com 5.3.2 chopconf C chopper configuration 0 x 6c, 0 x 7c: chopconf C c hopper c onfigurati on bit name function comment 31 - reserved set to 0 30 diss2g short to gnd protection disable 0: short to gnd protection is on 1: short to gnd protection is disabled 29 - reserved set to 0 28 - reserved set to 0 27 - reserved set to 0 26 - reserved set to 0 25 - reserved set to 0 24 - reserved set to 0 23 sync3 sync pwm synchronization clock this register allows synchronization of the chopper for both phases of a two phase motor in order to avoid the occurrence of a beat, especially at low motor v elocities. it is automatically switched off above vhigh . %0000: chopper sync function chopsync off %0001 %1111: synchronization with f sync = f clk /(sync*64) hint: set toff to a low value, so that the chopper cycle is ended, before the next sync clock pu lse occurs. set for the double desired chopper frequency for chm=0, for the desired base chopper frequency for chm=1. 22 sync2 21 sync1 20 sync0 19 vhighchm high velocity chopper mode this bit enables switching to chm =1 and fd =0, when vhigh is ex ceeded. this way, a higher velocity can be achieved. can be combined with vhighfs =1. if set, the toff setting automatically becomes doubled during high velocity operation in order to avoid doubling of the chopper frequency. 18 vhighfs high velocity fullst ep selection this bit enables switching to fullstep, when vhigh is exceeded. switching takes place only at 45 position. the fullstep target current uses the current value from the microstep table at the 45 position. 17 vsense sense resistor voltage base d current scaling 0: low sensitivity, high sense resistor voltage 1: high sensitivity, low sense resistor voltage 16 tbl1 tbl blank time select %00 %11: set comparator blank time to 16, 24, 36 or 54 clocks hint: %10 is recommended for most applications 15 tbl0 14 chm chopper mode 0 standard mode (spreadcycle) 1 constant off time with fast decay time. fast decay time is also terminated when the negative nominal current is reached. fast decay is after on time. 13 rndtf random toff time 0 cho pper off time is fixed as set by toff 1 random mode, toff is random modulated by d nclk = - 12 +3 clocks. 12 disfdcc fast decay mode chm=1: disfdcc=1 disables current comparator usage for termi - nation of the fast decay cycle 11 fd3 tfd [3] chm=1: msb of fast decay time setting tfd
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 29 www.trinamic.com 0 x 6c, 0 x 7c: chopconf C c hopper c onfigurati on bit name function comment 10 hend3 hend hysteresis low value offset sine wave offset chm =0 %0000 %1111: 1, 0, 1, , 12 9 hend2 8 hend1 7 hend0 chm =1 %0000 %1111: 1, 0, 1, , 12 6 hstrt2 hstrt hysteresi s start value added to hend chm =0 %000 %111: add 1, 2, , 8 to hysteresis low value hend (1/512 of this setting adds to current setting) attention: effective hend + hstrt 16. 5 hstrt1 4 hstrt0 tfd [2..0] fast decay time setting chm =1 fast decay time setting (msb: fd3 ): %0000 %1111: tfd with nclk = 32* hstrt (%0000: slow decay only) 3 toff3 toff off time and driver enable off time setting controls duration of slow d ecay phase nclk = 12 + 32* toff %0000: driver disable, all bridges off %0001: 1 C use only with tbl %0010 %1111: 2 15 2 toff2 1 toff1 0 toff0
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 30 www.trinamic.com 5.3.3 coolconf C smart energy control coolstep and stallguard2 0 x 6d, 0 x 7d: coolconf C s mart e nergy control cool s tep and stall g uard 2 bit name function comment - reserved set to 0 24 sfilt stallguard2 filter enable 0 standard mode, high time resolution for stallguard2 1 filtered mode, stallguard2 signal updated for each four fullsteps only to compensate for motor pole tolerances 23 - reserved set to 0 22 s gt6 stallguard2 threshold value this signed value controls stallguard2 level for stall output and sets the optimum measurement range for readout. a lower value gives a higher sensitivity. zero is the starting value working with most motors. - 64 to +63: a higher value makes stallguard2 less sensi tive and requires more torque to indicate a stall. 21 sgt5 20 sgt4 19 sgt3 18 sgt2 17 sgt1 16 sgt0 15 seimin minimum current for smart current control 0: 1/2 of current setting ( irun ) 1: 1/4 of current setting ( irun ) 14 sedn1 current down step speed %00: for each 32 stallguard2 values decrease by one %01: for each 8 stallguard2 values decrease by one %10: for each 2 stallguard2 values decrease by one %11: for each stallguard2 value decrease by o ne 13 sedn0 12 - reserved set to 0 11 semax3 stallguard2 hysteresis value for smart current control if the stallguard2 result is equal to or above ( semin + semax+ 1)*32, the motor current becomes decreased to save energy. %0000 %1111: 0 15 10 semax2 9 semax1 8 semax0 7 - reserved set to 0 6 seup1 current up step width current increment steps per measured stallguard2 value %00 %11: 1, 2, 4, 8 5 seup0 4 - reserved set to 0 3 semin3 minimum stallguard2 value for smart current control a nd smart current enable if the stallguard2 result falls below semin *32, the motor current becomes increased to reduce motor load angle. %0000: smart current control coolstep off %0001 %1111: 1 15 2 semin2 1 semin1 0 semin0
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 31 www.trinamic.com 5.3.4 drv_status C sta llguard2 value and driver error flags 0 x 6f, 0 x 7f: drv_status C stall g uard 2 value and driver err or flags bit name function comment 31 stst standstill indicator this flag indicates motor stand still in each operation mode. 30 olb open load indicator phas e b 1: open load detected on phase a or b hint: this is just an informative flag. the driver takes no action upon it. false detection may occur in fast motion and standstill. check during slow motion or after a motion , only 29 ola open load indicator pha se a 28 s 2gb short to ground indicator phase b 1: short to gnd detected on phase a or b. the driver becomes disabled. the flags stay active, until the driver is disabled by software ( toff =0) or by the enn input. 27 s 2ga short to ground indicator phase a 26 otpw overtemperature pre - warning flag 1: overtemperature pre - warning threshold is exceeded. the overtemperature pre - warning flag is common for both drivers. 25 ot overtemperature flag 1: overtemperature limit has been reached. drivers become disable d until otpw is also cleared due to cooling down of the ic. the overtemperature flag is common for both drivers. 24 stallguard stallguard2 status 1: motor stall detected ( sg_result =0) 23 - reserved ignore these bits 22 21 20 cs actual actual mot or current / smart energy current actual current control scaling, for monitoring smart energy current scaling controlled via settings in register coolconf , or for monitoring the function of the automatic current scaling. 19 18 17 16 15 fsa ctive full step active indicator 1: indicates that the driver has switched to fullstep as de fi ned by chopper mode settings and velocity thre sholds. 14 - reserved ignore these bits 13 12 11 10 9 sg_ result stallguard2 result respective ly pwm on time for coil a in stand still for motor temperature detection mechanical load measurement: the stallguard2 result gives a means to measure mecha nical motor load. a higher value means lower mecha nical load. a value of 0 signals highest load. wi th opti mum sgt setting, this is an indicator for a motor stall. the stall detection compares sg_result to 0 in order to detect a stall. sg_result is used as a base for coolstep operation, by comparing it to a pro grammable upper and a lower limit. stallgu ard2 works best with microstep operation. temperature measurement: in standstill, no stallguard2 result can be obtained. sg_result shows the chopper on - time for motor coil a instead. if the motor is moved to a determined micro step position at a certain c urrent setting, a comparison of the chopper on - time can help to get a rough estimation of motor temperature. as the motor heats up, its coil resistance rises and the chopper on - time increases. 8 7 6 5 4 3 2 1 0
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 32 www.trinamic.com 6 curre nt setting the internal 5 v supply voltage available at the pin 5vout is used as a reference for the coil current regulation based on the sense resistor voltage measurement. the desired maximum motor current is set by selecting an appropriate value for the sense resistor. the sense resistor voltage range can be selected by the vsense bit in chopconf . the low sensitivity setting (high sense resistor voltage, vsense =0) brings best and most robust current regulation, while high sensitivity (low sense resistor voltage, vsense =1) reduces power dissipation in the sense resistor. the high sensitivity setting reduces the power dissipation in the sense resistor by nearly half. after choosing the vsense setting and selecting the sense resistor, the currents to both c oils are scaled by the 5 - bit current scale parameters ( ihold , irun ). the sense resistor value is chosen so that the maximum desired current (or slightly more) flows at the maximum current setting ( irun = %11111). using the internal sine wave table, which has the amplitude of 248, the rms motor current can be calculated by: ? ??? = ?? + 1 32 ? ? ?? ? ????? + 20 ? ? ? 1 2 the momentary motor current is calculated by: ? ??? = ??? ? / ? 248 ? ?? + 1 32 ? ? ?? ? ????? + 20 ? ? cs is the current scale setting as set by the ihold and irun a nd coolstep. v fs is the full scale voltage as determined by vsense control bit (please refer to electrical characteristics, v srtl and v srth ). cur a/b is the actual value from the internal sine wave table. the internal resistance of 20m? will be increased by external trace resistance, 5m? are realistic. c hoice of r sense and resulting max . motor current r sense [?] rms current [a] (cs=31, vsense=0) rms current [a] (cs=31, vsense=1) 1.00 0.21 0.12 0.82 0.26 0.15 0.75 0.28 0.16 0.68 0.31 0.18 0.50 0.42 0 .24 0.47 0.45 0.25 0.33 0.63 0.35 0.27 0.76 0.43 0.22 0.91 0.51 0.15 1.29*) 0.72 *) value exceeds upper current rating. hint for best precision of current setting, it is advised to measure and fine tune the current in the application.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 33 www.trinamic.com parameter de scription setting comment irun current scale when motor is running. scales coil current values as taken from the internal sine wave table. for high precision motor operation, work with a current scaling factor in the range 16 to 31, because scaling down the current values reduces the effective microstep resolution by making microsteps coarser. this setting also controls the maximum current value set by coolstep. 0 31 1/32, 2/32, 32/32 ihold identical to irun , but for motor in stand s till. ihold delay allows smooth current reduction from run current to hold current. iholddelay controls the number of clock cycles for motor power down after t zerowait in increments of 2^18 clocks: 0=instant power down, 1..15: current reduction delay pe r current step in multiple of 2^18 clocks. example: when using irun =31 and ihold =16, 15 current steps are required for hold current reduction. a iholddelay setting of 4 thus results in a power down time of 4*15*2^18 clock cycles, i.e. roughly one second a t 16mhz. 0 instant ihold 1 15 18 15*2 18 clocks per current decrement vsense allows control of the sense resistor voltage range for full scale current. 0 0.32 v 1 0.18 v 6.1 sense resistors sense resistors should be carefully selected. the full motor current flows through the sense resistors. they also see the switching spikes from the mosfet bridges. a low - inductance type such as film or composition resistors is required to prevent spikes causing ringing on the sense voltage inputs leading to unstable measurement results. a low - inductance, low - resistance pcb layout is essential. any common gnd path for the two sense resistors must be avoided, because this woul d lead to coupling between the two current sense signals. a massive ground plane is best. please also refer to layout considerations in chapter 17.3 . the sense resistor needs to be able to conduct the peak motor coil current i n motor standstill conditions, unless standby power is reduced. under normal conditions, the sense resistor sees a bit less than the coil rms current, because no current flows through the sense resistor during the slow decay phases. the peak sense resisto r power dissipation is: ? ????? = ? ???? 2 ? ? ????? for high current applications, power dissipation is halved by using the low vsense setting and using an adapted resistance value. please be aware, that in this case any voltage drop in pcb traces has a larg er influence on the result. a compact layout with massive ground plane is best to avoid parasitic resistance effects.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 34 www.trinamic.com 7 chopper operation the currents through both motor coils are controlled using choppers. the choppers work independently of each other. i n f igure 7 . 1 the different chopper phases are shown. f igure 7 . 1 chopper phases although the current could be regulated using only on phases and fast dec ay phases, insertion of the slow decay phase is important to reduce electrical losses and current ripple in the motor. the duration of the slow decay phase is specified in a control parameter and sets an upper limit on the chopper frequency. the current co mparator can measure coil current during phases when the current flows through the sense resistor, but not during the slow decay phase, so the slow decay phase is terminated by a timer. the on phase is terminated by the comparator when the current through the coil reaches the target current. the fast decay phase may be terminated by either the comparator or another timer. when the coil current is switched, spikes at the sense resistors occur due to charging and discharging parasitic capacitances. during thi s time, typically one or two microseconds, the current cannot be measured. blanking is the time when the input to the comparator is masked to block these spikes. there are two chopper modes available: a new high - performance chopper algorithm called spreadc ycle and a proven constant off - time chopper mode. the constant off - time mode cycles through three phases: on, fast decay, and slow decay. the spreadcycle mode cycles through four phases: on, slow decay, fast decay, and a second slow decay. the chopper freq uency is an important parameter for a chopped motor driver. a too low frequency might generate audible noise. a high er frequency reduces current ripple in the motor, but with a too high frequency magnetic losses may rise. also power dissipation in the driv er rises with increasing frequency due to the increased influence of switching slopes causing dynamic dissipation. therefore, a compromise needs to be found. most motors are optimally working in a frequency range of 20 khz to 3 0 khz. the chopper frequency is influenced by a number of parameter settings as well as by the motor inductivity and supply voltage. hint a chopper frequency in the range of 16 khz to 3 0 khz gives a good result for most motors. a higher frequency leads to increased switching losses. it is advised to check the resulting frequency and to work below 50 khz. r s e n s e i c o i l o n p h a s e : c u r r e n t f l o w s i n d i r e c t i o n o f t a r g e t c u r r e n t r s e n s e i c o i l f a s t d e c a y p h a s e : c u r r e n t f l o w s i n o p p o s i t e d i r e c t i o n o f t a r g e t c u r r e n t r s e n s e i c o i l s l o w d e c a y p h a s e : c u r r e n t r e - c i r c u l a t i o n + v m + v m + v m
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 35 www.trinamic.com three parameters are used for controlling both chopper modes: 7.1 spreadcycle chopper the spreadcycle (pat. ) chopper algorithm is a precise and simple to use chopper mo de which automatically determines the optimum length for the fast - decay phase. several parameters are available to optimize the chopper to the application. each chopper cycle is comprised of an on phase, a slow decay phase, a fast decay phase and a second slow decay phase (see f igure 7 . 3 ). the two slow decay phases and the two blank times per chopper cycle put an upper limit to the chopper frequency. the slow decay phases typically make up for about 3 0% - 7 0 % of the chopper cycle in standstill and are important for low motor and driver power dissipation. calculation of a starting value for the slow decay time toff : assumptions: target chopper frequency: 25 khz two slow decay cycles make up for 50 % of overall chopper cycle time ? ??? = 1 25 ??? ? 50 100 ? 1 2 = 10 ? for the toff setting this means: ???? = ( ? ??? ? ? ??? ? 12 ) / 32 with 12 mhz clock this gives a setting of toff= 3.4 , i.e. 3 or 4 . with 16 mhz clock this gives a setting of toff= 4.6 , i.e. 4 or 5 . the hysteresis start setting forces the driver to introduce a minimum amount of current ripple into the motor coils. the current ripple must be higher than the current ripple which is caused by resistive losses in the motor in order to give best microstepping results. this will allow the chopper to precisely regulate the current both for rising and for falling target current. the time required to introduce the current ripple into the motor coil also reduces the chopper frequency. therefore, a higher hysteresis setting will lead to a lower chopper frequency. the motor inductance limits the ability of the chopper to follow a changing motor current. further the duration of the on phase and the fast decay must be longer than the blanking time, because the current co mparator is disabled during blanking. it is easiest to find the best setting by starting from a low hysteresis setting (e.g. hstrt =0, hend =0) and increasing hstrt, until the motor runs smoothly at low velocity settings. this can best be checked when meas uring the motor current either with a current probe or by probing the sense resistor voltages (see figure 7 . 2 ). checking the sine wave shape near zero transition will show a small ledge between both half waves in case the hysteres is setting is too small. at medium velocities (i.e. parameter description setting comment toff sets the slow decay time ( off time ). this setting also limits the maximum chopper frequency. setting this parameter to zero completely disables all driver transistors and the motor can free - wheel. 0 chopper off 115 clk = 12 + 32* toff (1 will work with minimum blank time of 24 clocks) tbl selects the comp arator blank time . this time needs to safely cover the switching event and the duration of the ringing on the sense resistor. for most applications, a setting of 1 or 2 is good. for highly capacitive loads, e.g. when filter networks are used, a setting of 2 or 3 will be required. 0 16 t clk 1 24 t clk 2 36 t clk 3 54 t clk chm selection of the chopper mode 0 spreadcycle 1 classic const. off time
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 36 www.trinamic.com 100 to 400 fullsteps per second), a too low hysteresis setting will lead to increased humming and vibration of the motor. figure 7 . 2 n o ledges in curren t wave with sufficient hysteresis (magenta: current a, yellow & blue: sense resistor voltages a and b) a too high hysteresis setting will lead to reduced chopper frequency and increased chopper noise but will not yield any benefit for the wave shape. quic k start for a quick start, see the quick configuration guide in chapter 13 . for detail procedure see application note an00 1 - parameterization of spreadcycle as experiments show, the setting is quite independent of the motor, because higher current motors typically also have a lower coil resistance. therefore choosing a low to medium default value for the hysteresis (for example, effective hysteresis = 4) normally fits most applications. the setting can be optimized by experime nting with the motor: a too low setting will result in reduced microstep accuracy, while a too high setting will lead to more chopper noise and motor power dissipation. when measuring the sense resistor voltage in motor standstill at a medium coil current with an oscilloscope, a too low setting shows a fast decay phase not longer than the blanking time. when the fast decay time becomes slightly longer than the blanking time, the setting is optimum. you can reduce the off - time setting, if this is hard to rea ch. the hysteresis principle could in some cases lead to the chopper frequency becoming too low, e.g. when the coil resistance is high when compared to the supply voltage. this is avoided by splitting the hysteresis setting into a start setting ( hstrt+hen d ) and an end setting ( hend ). an automatic hysteresis decrementer (hdec) interpolates between both settings, by decrementing the hysteresis value stepwise each 16 system clocks. at the beginning of each chopper cycle, the hysteresis begins with a value whi ch is the sum of the start and the end values ( hstrt + hend ), and decrements during the cycle, until either the chopper cycle ends or the hysteresis end value ( hend ) is reached. this way, the chopper frequency is stabilized at high amplitudes and low supply voltage situations, if the frequency gets too low. this avoids the frequency reaching the audible range.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 37 www.trinamic.com f igure 7 . 3 spreadcycle chopper scheme showing coil current during a choppe r cycle two parameters control spreadcycle mode: parameter description setting comment hstrt hysteresis start setting. this value is an offset from the hysteresis end value hend . 07 hstrt =18 hend hysteresis end setting. sets t he hysteresis end value after a number of decrements. the sum hstrt + hend must be 02 3 415 112: positive hend example: in the example a hysteresis of 4 has been chosen. you might decide to not use hysteresis dec rement. in this case set: hend =6 (sets an effective end value of 6 - 3=3) hstrt =0 (sets minimum hysteresis, i.e. 1: 3+1=4 ) in order to take advantage of the variable hysteresis, we can set most of the value to the hstrt, i.e. 4, and the remaining 1 to hyst eresis end. the resulting configuration register values are as follows: hend =0 (sets an effective end value of - 3) hstrt =6 (sets an effective start value of hysteresis end +7: 7 - 3=4) hint highest motor velocities sometimes benefit from setting toff to 1 , 2 or 3 and a short tbl of 1 or 0. t i t a r g e t c u r r e n t t a r g e t c u r r e n t - h y s t e r e s i s s t a r t t a r g e t c u r r e n t + h y s t e r e s i s s t a r t o n s d f d s d t a r g e t c u r r e n t + h y s t e r e s i s e n d t a r g e t c u r r e n t - h y s t e r e s i s e n d h d e c
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 38 www.trinamic.com 7.2 classic 2 - phase motor constant off time chopper the classic constant off time chopper is an alternative to spreadcycle. perfectly tuned, it also gives good results. t he classic constant off time chopper is best when u sing the high velocity switch to fullstepping option . the classic constant off - time chopper uses a fixed - time fast decay following each on phase. while the duration of the on phase is determined by the chopper comparator, the fast decay time needs to be l ong enough for the driver to follow the falling slope of the sine wave, but it should not be so long that it causes excess motor current ripple and power dissipation. this can be tuned using an oscilloscope or evaluating motor smoothness at different veloc ities. a good starting value is a fast decay time setting similar to the slow decay time setting. f igure 7 . 4 classic const. off time chopper with offset showing coil current afte r tuning the fast decay time, the offset should be tuned for a smooth zero crossing. this is necessary because the fast decay phase makes the absolute value of the motor current lower than the target current (see f igure 7 . 5 ). if t he zero offset is too low, the motor stands still for a short moment during current zero crossing. if it is set too high, it makes a larger microstep. typically, a positive offset setting is required for smoothest operation. f igure 7 . 5 zero crossing with classic chopper and correction using sine wave offset three parameters control constant off - time mode: t i m e a n v a l u e = t a r g e t c u r r e n t t a r g e t c u r r e n t + o f f s e t o n s d f d s d o n f d t i t a r g e t c u r r e n t c o i l c u r r e n t t i t a r g e t c u r r e n t c o i l c u r r e n t c o i l c u r r e n t d o e s n o t h a v e o p t i m u m s h a p e t a r g e t c u r r e n t c o r r e c t e d f o r o p t i m u m s h a p e o f c o i l c u r r e n t
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 39 www.trinamic.com parameter description setting comment tfd ( fd3 & hstrt ) fast decay time se tting. with chm=1, these bits control the portion of fast decay for each chopper cycle. 0 slow decay only 115 offset ( hend ) sine wave offset . with chm=1, these bits control the sine wave offset. a positive offset corrects for zero crossing error. 02 3 415 positive offset 112 disfdcc selects usage of the current comparator for termination of the fast decay cycle. if current comparator is enabled, it terminates the fast decay cycl e in case the current reaches a higher negative value than the actual positive value. 0 enable comparator termination of fast decay cycle 1 end by time only 7.3 random off time in the constant off - time chopper mode, both coil choppers run freely without synchronization. the frequency of each chopper mainly depends on the coil current and the motor coil inductance. the inductance varies with the microstep position. with some motors, a slightly audible beat can occur between the chopper frequencies when the y are close together. this typically occurs at a few microstep positions within each quarter wave. this effect is usually not audible when compared to mechanical noise generated by ball bearings, etc. another factor which can cause a similar effect is a po or layout of the sense resistor gnd connections. hint a common factor, which can cause motor noise, is a bad pcb layout causing coupling of both sense resistor voltages (please refer layouts hint in chapter 17.3 ). to minimize the effect of a beat between both chopper frequencies, an internal random generator is provided. it modulates the slow decay time setting when switched on by the rndtf bit. the rndtf feature further spreads the chopper spectrum, reducing e lectromagnetic emission on single frequencies. parameter description setting comment rndtf this bit switches on a random off time generator, which slightly modulates the off time toff using a random polynomial. 0 disable 1 random modulation enable
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 40 www.trinamic.com 7.4 chopsync2 for quiet motor s while a frequency adaptive chopper like spreadcycle provides excellent high velocity operation, in some applications, a constant frequency chopper is preferred rather than a frequency adaptive chopper. this may be due to choppe r noise in motor standstill, or due to electro - magnetic emission. chopsync provides a means to synchronize the choppers for both coils with a common clock, by extending the off time of the coils. it integrates with both chopper principles. however, a caref ul set up of the chopper is necessary, because chopsync2 can just increment the off times, but not reduce the duration of the chopper cycles themselves. therefore, it is necessary to test successful operation best with an oscilloscope. set up the chopper a s detailed above, but take care to have chopper frequency higher than the chopsync2 frequency. as high motor velocities take advantage of the normal, adaptive chopper style, chopsync2 becomes automatically switched off using the vhigh velocity limit progra mmed within the motion controller. example: the motor is operated in spreadcycle mode ( chm =0). the minimum chopper frequency for standstill and slow motion (up to vhigh ) has been determined to be 25 khz under worst case operation conditions (hot m otor, low supply voltage). the standstill noise needs to be minimized by using chopsync. the ic uses an external 16 mhz clock. considering the chopper mode 0, sync has to be set for the closest value resulting in or below the double frequency, e.g. 50 khz . using above formula, a value of 5 results exactly and can be used. trying a value of 6, a frequency of 41.7 khz results, which still gives an effective chopper frequency of slightly above 20 khz, and thus would also be a valid solution. a value of 7 migh t still be good, but could already give high frequency noise. in chopper mode 1, sync could be set to any value between 10 and 13 to be within the chopper frequency range of 19.8 khz to 25 khz. parameter description setting comment sync this register all ows synchronization of the chopper for both phases of a two phase motor in order to avoid the occurrence of a beat, especially at low motor velocities. it is automatically switched off above vhigh . hint: set toff to a low value, so that the chopper cycle is ended, before the next sync clock pulse occurs. set sync for the double desired chopper frequency for chm =0, for the desired base chopper frequency for chm =1. 0 chopsync off 115 clk /64 clk /(15*64) ???? = ? ? ??? 64 ? ? ???? ? a suitable chopsync2 sync value can be calculated as follows:
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 41 www.trinamic.com 8 driver diagnostic flags the tmc 5031 drive rs supply a complete set of diagnostic and protection capabilities, like short to gnd protection and undervoltage detection. a detection of an open load condition allows testing if a motor coil connection is interrupted. see the drv_status table for detail s. 8.1 temperature measurement the driver integrates a two level temperature sensor (120c pre - warning and 150c thermal shutdown) for diagnostics and for protection of t he ic against excess heat. h eat is mainly generated by the motor driver stages, and, at increased voltage, by the internal voltage regulator. most critical situations, where the driver mosfets could be overheated, are avoided when enabling the short to gnd protection. for many applications, the overtemperature pre - warning will indicate an abn ormal operation situation and can be used to initiate user warning or power reduction measures like motor current reduction. the thermal shutdown is just an emergency measure and temperature rising to the shutdown level should be prevented by design. afte r triggering the over temperature sensor ( ot flag), the driver remains switched off until the system temperature falls below the pre - warning level ( otpw ) to avoid continuous heating to the shut down level. 8.2 short to gnd protection the tmc 5031 power stages are protected against a short circuit condition by an additional measure - ment of the current flowing through the high - side mosfets. this is important, as most short circuit conditions result from a motor cable insulation defect, e.g. when touching the cond ucting parts connected to the system ground. the short detection is protected against spurious triggering, e.g. by esd discharges, by retrying three times before switching off the motor. once a short condition is safely detected, the corresponding driver bridge becomes switched off, and the s2g a or s2gb flag becomes set. in order to restart the motor, the user must intervene by disabling and re - enabling the driver. it should be noted, that the short to gnd protection cannot protect the system and the powe r stages for all possible short events, as a short event is rather undefined and a complex network of external components may be involved. therefore, short circuits should basically be avoided. 8.3 open load diagnostics interrupted cables are a common cause f or systems failing, e.g. when connectors are not firmly plugged. the tmc 5031 detects open load conditions by checking, if it can reach the desired motor coil current. this way, also undervoltage conditions, high motor velocity settings or short and overtem perature conditions may cause triggering of the open load flag, and inform the user, that motor torque may suffer. in motor stand still, open load cannot be measured, as the coils might eventually have zero current. in order to safely detect an interrupt ed coil connection, read out the open load flags at low or nominal motor velocity operation, only. however, the ol a and olb flags have just informative character and do not cause any action of the driver.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 42 www.trinamic.com 9 ramp generator the ramp generator allows motion based on target position or target velocity. it automatically calculates the optimum motion profile taking into account acceleration and velocity settings. the tmc 5031 integrates a new type of ramp generator, which offers faster machine operation compared to the classical linear acceleration ramps. the sixpoint ramp generator allows adapting the acceleration ramps to the torque curves of a stepper motor and uses two different acceleration settings each for the acceleration phase and for the deceleration pha se. see f igure 9 . 2 . 9.1 real world unit conversion the tmc 5031 uses its internal or external clock signal as a time reference for all internal operations. thus, all time, velocity and acceleration settings are referen ced to f clk . for best stability and reproducibility, it is recommended to use an external quartz oscillator as a time base, or to provide a clock signal from a microcontroller. the units of a tmc 5031 register content are written as register[ 5031 ]. p aram eter vs . u nits parameter / symbol unit calculation / description / comment f clk [hz] [hz] clock frequency of the tmc 5031 in [hz] s [s] second us step fs fullstep step velocity v[hz] steps / s v[hz] = v[ 5031 ] * ( f clk [hz]/2 / 2^23 ) step acceler ation a[hz/s] steps / s^2 a[hz/s] = a[ 5031 ] * f clk [hz]^2 / (512*256) / 2^24 usc microstep count counts microstep resolution in number of microsteps (i.e. the number of microsteps between two fullsteps C quick start for a quick start, see the quick configuration guide in chapter 13 .
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 43 www.trinamic.com 9.2 motion profiles for the ramp generator register set, please refer to the chapter 0 . 9.2.1 ramp mode the ramp generator delivers two phase acceleration and two phase deceleration ramps with additional programmable start and stop velocities (see f igure 9 . 1 ). the two different set s of acceleration and deceleration can be combined fr eely . a common transition speed v1 allows for velocity dependent switching between both acceleration and deceleration settings . a typical use case will use lower acceleration and deceleration values at h igher velocities, as the motors torque declines at higher velocity. when considering friction in the system, it becomes clear, that typically deceleration of the system is quicker than acceleration. thus, deceleration values can be higher in many applicati ons. this way, operation speed of the motor in time critical applications can be maximized. as target positions and ramp parameters may be changed any time during the motion, the motion controller will always use the optimum (fastest) way to reach the tar get, while sticking to the constraints set by the user. this way it might happen, that the motion becomes automatically stopped, crosses zero and drives back again. this case is flagged by the special flag second_move. 9.2.2 start and stop velocity when using i ncreased levels of start - and stop velocity, it becomes clear, that a subsequent move into the opposite direction would provide a jerk identical to vstart + vstop , rather than only vstart . as the motor probably is not able to follow this, you can set a time delay for a subsequent move by setting tzerowait . an active delay time is flagged by the flag t_zerowait_active . once the target position is reached, the flag pos ition _reached becomes active. f igure 9 . 1 ramp generator velocity trace showing consequent move in negative direction note the start velocity can be set to zero, if n ot used. t he stop v elocity can be set to ten (or down to one), if not used. take care to always set vstop identical to or above vstart . this ensures that even a short motion can be terminated successfully at the target position. v t a c c e l e r a t i o n p h a s e d e c e l e r a t i o n p h a s e m o t o r s t o p v s t o p v s t a r t 0 v 1 v m a x a m a x d m a x d 1 a 1 - a 1 t z e r o w a i t a c c e l e r a t i o n p h a s e v a c t u a l
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 44 www.trinamic.com f igure 9 . 2 illustration of optimized motor torque usage with tmc 5031 ramp generato r 9.2.3 velocity mode for the ease of use, velocity mode movements do not use the different acceleration and deceleration settings. you need to set vmax and amax only for velocity mode. the ramp generator always uses amax to accelerate or decelerate to vmax in this mode. in order to decelerate the motor to stand still, it is sufficient to set vmax to zero. the flag vzero signals standstill of the motor. the flag velocity_reached always signals, that the target velocity has been reached. please see chapter 0 for a known restriction of the velocity mode. 9.3 interrupt handling the motion controllers provide the capability to issue an interrupt to the microcontroller, e.g. in order to react on a position reached event. in case more than one interrupt source is possible, it is necessary to carefully check for the actual event, without risking losing an event. i nterrupt handling fo r 2 a xis (e xample for pos ition _ reached ) : 1. read ramp_stat1 to clear the interrupt flags. this will turn off the interrupt source. 2. check xactual1 for reaching of the target position (and any other conditions you want to check for ramp 1). 3. do the same for ramp_stat2 and xactual2 . this way, you are sure that you will not miss any position _reached condition, because yo u first clear the flags, and afterwards read out the condition. 9.4 velocity thresholds the ramp generator provides a number of velocity thresholds coupled to the actual velocity vactual . the different ranges allow programming the motor to the optimum step m ode, coil current and acceleration settings. t o r q u e f o r v s t a r t t o r q u e a v a i l a b l e f o r a m a x t o r q u e a v a i l a b l e f o r a c c e l e r a t i o n a 1 t o r q u e r e q u i r e d f o r s t a t i c l o a d s t o r q u e v e l o c i t y [ r p m ] 0 m f r i c t m m a x v m a x m f r i c t p o r t i o n o f t o r q u e r e q u i r e d f o r f r i c t i o n a n d s t a t i c l o a d w i t h i n t h e s y s t e m m m a x m o t o r p u l l - o u t t o r q u e a t v = 0 m o t o r t o r q u e m n o m 2 h i g h a c c e l e r a t i o n r e d u c e d a c c e l . v 1 m n o m 1 m n o m 1 / 2 t o r q u e a v a i l a b l e a t v 1 r e s p . v m a x m o t o r t o r q u e u s e d i n a c c e l e r a t i o n p h a s e h i g h d e c e l e r a t i o n r e d u c e d d e c e l . 2 x m f r i c t o v e r a l l t o r q u e u s a b l e f o r d e c e l e r a t i o n v s t a r t
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 45 www.trinamic.com f igure 9 . 3 ramp generator velocity dependent motor control note since it is not necessary to differentiate the velocity to the last detail, the velocity thresholds use a reduced number of bits for comparison and the lower eight bits of the compare values become ignored. h i g h v e l o c i t y f u l l s t e p m i c r o s t e p + c o o l s t e p m i c r o s t e p + c o o l s t e p m i c r o s t e p p i n g m i c r o s t e p p i n g m o t o r s t a n d s t i l l m o t o r g o i n g t o s t a n d b y m o t o r i n s t a n d b y m o t o r i n s t a n d b y v t v s t o p v s t a r t 0 v 1 v m a x a m a x d m a x d 1 a 1 v a c t u a l v c o o l t h r s v h i g h c u r r e n t t z e r o w a i t r m s c u r r e n t i _ h o l d i _ r u n d i * i h o l d d e l a y c o o l s t e p c u r r e n t r e d u c t i o n
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 46 www.trinamic.com 9.5 reference switches prior to normal operation of the drive an absolute reference position must be set . the referenc e position can be found using a mechanical stop which can be detected by stall detection, or by a reference switch. in case of a linear drive, the mechanical motion range must not be left. this can be ensured also for abnormal situations by enabling the stop switch functions for the left and the right reference switch. therefore, the ramp generator responds to a number of stop events as configured in the sw_mode register. there are two ways to stop the motor: - it can be stopped abruptly, when a switch is h it. this is useful in an emergency case and for stallguard based homing. - or the motor can be softly decelerated to zero using deceleration settings ( dmax , v1 , d1 ) . hint latching of the ramp position xactual to the holding register xlatch upon a switch ev ent gives a precise snapshot of the position of the reference switch. f igure 9 . 4 using reference switches (example) normally o pen or normally closed switches can be used by progr amming the switch polarity or selecting the pull - up or pull - down resistor configuration. a normally closed switch is failsafe with respect to an interrupt of the switch connection. switches which can be used are: - mechanical switches, - photo interrupters , o r - hall sensors. be careful to select reference switch resistors matching you r switch requirements! in case of long cables additional rc filtering might be required near the tmc 5031 reference inputs. adding an rc filter will also reduce the danger of de stroying the logic level inputs by wiring faults, but it will add a certain delay which should be considered with respect to the application. i mplementing a h oming p rocedure 1. make sure, that the home switch is not pressed, e.g. by moving away from the swi tch. 2. activate position latching upon the desired switch event and activate motor (soft) stop upon active switch. stallguard based homing requires using a hard stop ( en_softstop =0). 3. start a motion ramp into the direction of the switch. (move to a more nega tive position for a left switch, to a more positive position for a right switch). you may timeout this motion by using a position ramping command. 4. as soon as the switch is hit, the position becomes latched and the motor is stopped. wait until the motor is in standstill again by polling the actual velocity v actual or checking vzero or the standstill flag. please be aware that reading ramp_stat may clear flags (e.g. sg_stop ) and thus the motor may restart after expiration of tzerowait . in case the stop condit ion might be reset + v c c _ i o r e f _ l t r a v e l e r m o t o r + v c c _ i o r e f _ r n e g a t i v e d i r e c t i o n p o s i t i v e d i r e c t i o n 1 0 k 1 0 k 2 2 k 1 n f o p t i o n a l r c f i l t e r ( e x a m p l e )
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 47 www.trinamic.com by the read and clear (r+c) function, be sure to execute step 5 within the time range set by tzerowait . 5. switch the ramp generator to hold mode and calculate the difference between the latched position and the actual position. for stallgu ard based homing or when using hard stop, xactual stops exactly at the home position, so there is no difference (0). 6. write the calculated difference into the actual position register. now, homing is finished. a move to position 0 will bring back the motor exactly to the switching point. in case stallguard was used for homing, a read access to ramp_stat clears the stallguard stop event event_stop_sg and releases the motor from the stop condition. 9.6 restrictions of ramp generator (errata) when the tmc5 031 bec omes stopped in velocity mode, there is an irregularity of the position counter failing and counting continuously with clock frequency until the next move is commanded. failure condition: 1. motor is moving in velocity mode 2. master sets vmax =0 to stop the mo tion 3. upon reaching of vactual =0, the position counter may start counting with clock frequency (the deterministically probability for this behavior occurring is about 1/16 million.) in this situation the motor is correctly in standstill and also the ramp s tate reports the motor to be stopped. when starting the motor again, the position counter continues from the new (wrong) position. this behavior leads to a loss of the synchronization between the position counter and the motor position. background: the r estriction is caused by a failure state, which involves the state of the internal velocity pulse generator and the actual point of time, when the velocity becomes zero. when the velocity vactual becomes decreased from one to zero with the 24 bit ramp gener ator register in a certain state, the xactual position counter gets to a state where it counts up despite the velocity now being zero. this can occur in velocity mode only, because in this mode the internal change of the velocity register is not coupled to an advance in the actual position. the statistical probability for the occurrence of the failure is given by the combination of 2^24 (i.e. 16m) possible states of the accumulation register, with one of the states leading to a fail. if the one state of the accumulation register, which leads to an overflow of the register in case of an accumulation of the last velocity value (1) before reaching zero occurs at exactly the same moment where the velocity actually goes to zero, the xactual counter gets caught in an endless loop. 9.6.1 velocity mode workaround there are two alternatives for a workaround. the first workaround is recommended for most applications which require the use of velocity mode. therefore the application software must allow polling a register on a deterministic, regular time interval. the second workaround has less real time relevance, as it just requires a read - modify - write instruction to execute within limited time. first software workaround for applications using velocity mode intensively the v elocity mode can be used, but in order to stop the motor, do not directly set vmax =0. workaround for stopping the motor: 1. set vmax to a low velocity, in the range 1 to 2000 (e.g. 100). even if vmax has been lower before, this ensures a quick termination of the stop procedure. exit the stop procedure, in case vmax already had been set to 0 before (motor is stopped). 2. check the velocity_reached flag to become active. alternatively, check if the absolute value of vactual is at or below the value selected for step 1. 3. poll xactual until a new step has been executed (i.e. xactual has changed) (with vmax =100 this will need at maximum about 10ms, with vmax =1000, about 1ms) (*)
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 48 www.trinamic.com 4. set amax to 65535 (0xffff) and set vmax to zero to finally stop the motor. this will st op the motor within a few microseconds. 5. wait until the motor is actually stopped ( vzero flag active) before starting a new motion. remember to set amax back to the original value before starting the next motion. step (3.) and (4.) are time critical: mak e sure that the delay between detection of the step execution by reading xactual and setting vmax =0 is significantly lower than the time between each two steps. no additional step shall be executed between (3.) and (4.). for example, when xactual can be ch ecked once each 5ms, use a step frequency of max. 100hz (10ms) for vmax in step (1.). you can test the procedure by checking that no further position change has been executed until step 5. do not switch between rampmode 1 and 2 (velocity in positive direc tion and velocity in negative direction), without stopping the motion as described above before changing the direction. second software workaround avoiding velocity mode operate the device in positioning mode instead of velocity mode. use a target posit ion far away to simulate a velocity mode movement, e.g. xtarget := xactual +2^30 to yield a positive motion direction, or xtarget := xactual - 2^30 for a negative direction. a smaller increment down to the span of the deceleration ramp also can be used, depending on how often the procedure is called. the target position this way can be increased in regular intervals in order to have an infinite running (even longer than the 32 bit position range). in order to stop the motor, cease incrementing xtarget . the motor will continue turning and decelerate in time to stop as commanded by the last increment. in order to stop the motor at the next possible position: 1. set vmax to a low velocity, in the range of minimum equal to vstop or up to about 1000 (e.g. 100). dependin g on the speed of execution of step 4 (mostly limited by communication between mcu and tmc), higher values can be chosen to speed up the motor stop process. 2. check the velocity_reached flag to become active. in case the position _reached flag becomes active, e xit the procedure as the motion has finished normally. 3. read out xactual. for a motion in positive direction, increase it by 2 (or more, e.g. 10 or 100, if desired), and write it to xtarget , for a motion in negative direction, decrease it accordingly. incre ase vstop to the same value which was selected for vmax in step 1. this will stop the motor within two steps (or 10, or 100) of the write access to xtarget . (with vmax =100 this will need at maximum about 10 - 20ms, with vmax =1000, about 1 - 2ms) 4. wait until the motor is actually stopped ( vzero flag active) before starting a new motion. remember to set vstop and vmax back to the original values before starting the next positioning move. the read - modify - write access in step (3.) is time critical: make sure that t he delay between reading xactual and writing to xtarget and vstop is significantly lower than the time required doing the remaining 2 steps (or more, as decided for the increment in step (3.)). otherwise the motor might reverse before stopping). with vstop =10, the remaining motion ramp will need about 200ms (*), with vstop =100 it will need about 20ms. (*) the time delays given relate to a clock frequency of about 16mhz. at 12mhz they are 25% longer.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 49 www.trinamic.com optional detection and correction this option risks th e occurrence of the error and detects and corrects it. the irregularity of the position counter can easily be detected by reading the counter twice whenever the motor is brought to standstill (vzero flag set). in case, two subsequent read accesses of xactu al show a different result during standstill, the position is lost. trigger a new homing sequence. this solution will work well for applications with a low sequence of motion tasks, which allow doing a new homing sequence. in case only one critical motio n command per minute is issued, the mean time to failure and automatic correction will be > 10 years. 9.6.2 tzerowait and vstart restriction this restriction applies in case that positioning mode is used with alternation of target - positions on - the - fly, i.e. whe n a reversal of the motion direction can occur due to a change of the target position, while the motor is moving. in this case, set tzerowait =0. set vstart to mi nimum 1 (or to a higher value) and vstop to the lowest value usable for the application, e.g. 2. hint: take care, that vstop is always required to be higher than vstart , i.e. vstop must be minimum 2. 9.6.3 stop switch handling restriction in case a stop switch is used for homing in conjunction with the automatic motor stop ( stop_l_enable =1 or stop_r_e nable =1), a soft stop shall be used (set en_softstop =1). set the deceleration parameters to the desired value. hint: in any case, a homing requires use of the soft stop, as a hard stop might lead to motor step loss. when reaching the reference switch, us e the automatic position latch register in order to have an exact reference of where the stop switch became active. use hard stop only for emergency stop. after a hard stop, initiate a new homing sequence, because position might be lost. hint: there is n o restriction of using a hard stop in conjunction with stallguard2 ( sg_stop =1). hard stop should be used with stallguard in any case, as a stall event means, that the motor is forced into stop.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 50 www.trinamic.com 10 stallguard2 load measurement stallguard2 provides an accurat e measurement of the load on the motor. it can be used for stall detection as well as other uses at loads below those which stall the motor, such as coolstep load - adaptive current reduction. the stallguard2 measurement value changes linearly over a wide ra nge of load, velocity, and current settings, as shown in f igure 10 . 1 . at maximum motor load, the value goes to zero or near to zero. this corresponds to a load angle of 90 between the magnetic field of the coils and magnets in th e rotor. this also is the most energy - efficient point of operation for the motor. f igure 10 . 1 function principle of stallguard2 parameter description setting comment sgt this sig ned value controls the stallguard2 threshold level for stall detection and sets the optimum measurement range for readout. a lower value gives a higher sensitivity. zero is the starting value working with most motors. a higher value makes stallguard2 less sensitive and requires more torque to indicate a stall. 0 indifferent value +1 +63 less sensitivity - 1 - 64 higher sensitivity sfilt enables the stallguard2 filter for more precision of the measurement. if set, reduces the measurement frequency to one measurement per electrical period of the motor (4 fullsteps). 0 standard mode 1 filtered mode status word description range comment sg this is the stallguard2 result . a higher reading indicates less mechanical load. a lower reading indicates a hig her load and thus a higher load angle. tune the sgt setting to show a sg reading of roughly 0 to 100 at maximum load before motor stall. 0 1023 0: highest load low value: high load high value: less load attention in order to use stallguard2 and coolstep , the stallguard2 sensitivity should first be tuned using the sgt setting! m o t o r l o a d ( % m a x . t o r q u e ) s t a l l g u a r d 2 r e a d i n g 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0 1 0 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 1 0 0 s t a r t v a l u e d e p e n d s o n m o t o r a n d o p e r a t i n g c o n d i t i o n s m o t o r s t a l l s a b o v e t h i s p o i n t . l o a d a n g l e e x c e e d s 9 0 a n d a v a i l a b l e t o r q u e s i n k s . s t a l l g u a r d v a l u e r e a c h e s z e r o a n d i n d i c a t e s d a n g e r o f s t a l l . t h i s p o i n t i s s e t b y s t a l l g u a r d t h r e s h o l d v a l u e s g t .
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 51 www.trinamic.com 10.1 tuning the stallguard2 threshold sgt t he stallguard2 value sg is affected by motor - specific characteristics and application - specific demands on load and velocity . therefore the ea siest way to tune the stallguard2 threshold sgt for a specific motor type and operating conditions is interactive tuning in the actual application. i nitial procedure for tuning stall g uard sgt 1. operate the motor at the normal operation velocity for your app lication and monitor sg . 2. apply slowly increasing mechanical load to the motor. if the motor stalls before sg reaches zero, decrease sgt . if sg reaches zero before the motor stalls, increase sgt . a good sgt starting value is zero. sgt is signed, so it can h ave negative or positive values. 3. now enable sg_stop and make sure, that the motor is safely stopped whenever it is stalled. increase sgt if the motor becomes stopped before a stall occurs. restart the motor by disabling sg_stop or by reading the ramp_stat register (read and clear function). 4. the optimum setting is reached when sg is between 0 and roughly 100 at increasing load shortly before the motor stalls, and sg increases by 100 or more without load. sgt in most cases can be tuned for a certain motion ve locity or a velocity range. make sure, that the setting works reliable in a certain range (e.g. 80% to 120% of desired velocity) and also under extreme motor conditions (lowest and highest applicable temperature). o ptional procedure a llowing automatic tu ni ng of sgt the basic idea behind the sgt setting is a factor, which compensates the stallguard measurement for resistive losses inside the motor. at standstill and very low velocities, resistive losses are the main factor for the balance of energy in the mo tor, because mechanical power is zero or near to zero. this way, sgt can be set to an optimum at near zero velocity. this algorithm is especially useful for tuning sgt within the application to give the best result independent of environment conditions, mo tor stray, etc. 1. operate the motor at low velocity < 10 rpm (i.e. a few to a few fullsteps per second) and target operation current and supply voltage. in this velocity range, there is not much dependence of sg on the motor load, because the motor does no t generate significant back emf. therefore, mechanical load will not make a big difference on the result. 2. switch on s filt . now increase sgt starting from 0 to a value, where sg starts rising. with a high sgt, sg will rise up to the maximum value. reduce again to the highest value, where sg stays at 0. now the sgt value is set as sensibly as possible. when you see sg increasing at higher velocities, there will be useful stall detection. the upper velocity for the stall detection with this setting is det ermined by the velocity, where the motor back emf approaches the supply voltage and the motor current starts dropping when further increasing velocity. sg goes to zero when the motor stalls and the ramp generator can be programmed to stop the motor upon a stall event by enabling sg_stop in sw_mode . monitor vactual to exceed the lower velocity threshold where stallguard delivers a good result and enable sg_stop during this time only. the system clock frequency affects sg . an external crystal - stabilized clo ck should be used for applications that demand the highest performance. the power supply voltage also affects sg , so tighter regulation results in more accurate values. sg measurement has a high resolution, and there are a few ways to enhance its accuracy, as described in the following sections. quick start for a quick start, see the quick configuration guide in chapter 13 . for detail procedure see application note an002 - parameterization of stallguard2 & coolstep
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 52 www.trinamic.com 10.1.1 variable velocity operation the sgt setting chosen as a result of the previously described sgt tuning can be used for a certain velocity range. outside this range, a stall may not be detected safely, and coolstep might not give the optimum result. figure 10 . 2 example: optimum sgt setting and stallguard2 reading with an example motor in many applications, operation at or near a single operation point is used most of the time and a single s etting is sufficient. the ramp generator provides a lower and an upper velocity threshold to match this. the stall detection should be ignored and disabled by software outside the determined operation point, e.g. during acceleration phases preceding a sens orless homing procedure. in some applications, a velocity dependent tuning of the sgt value can be expedient, using a small number of support points and linear interpolation. 10.1.2 small motors with high torque ripple and resonance motors with a high detent t orque show an increased variation of the stallguard2 measurement value sg with varying motor currents, especially at low currents. for these motors, the current dependency should be checked for best result. 10.1.3 temperature dependence of motor coil resistance motors working over a wide temperature range may require temperature correction, because motor coil resistance increases with rising temperature. this can be corrected as a linear reduction of sg at increasing temperature, as motor efficiency is reduced. 10.1.4 accuracy and reproducibility of stallguard2 measurement in a production environment, it may be desirable to use a fixed sgt value within an application for one motor type. most of the unit - to - unit variation in stallguard2 measurements results from manu - fa cturing tolerances in motor construction. the measurement error of stallguard2 C provided that all other parameters remain stable C can be as low as: ?????????? ??????????? ????? = ??? ( 1 , | ??? | ) b a c k e m f r e a c h e s s u p p l y v o l t a g e o p t i m u m s g t s e t t i n g m o t o r r p m ( 2 0 0 f s m o t o r ) s t a l l g u a r d 2 r e a d i n g a t n o l o a d 2 4 6 8 1 0 1 2 1 4 1 6 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0 1 0 0 0 1 8 2 0 0 0 5 0 1 0 0 1 5 0 2 0 0 2 5 0 3 0 0 3 5 0 4 0 0 4 5 0 5 0 0 5 5 0 6 0 0 l o w e r l i m i t f o r s t a l l d e t e c t i o n g o o d o p e r a t i o n r a n g e w i t h s i n g l e s g t s e t t i n g
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 53 www.trinamic.com 10.2 stallguard2 update rate and filter the stallguard2 measurement value sg is updated with each full step of the motor. this is enough to safely detect a stall, because a stall alw ays means the loss of four full steps. in a practical application, especially when using coolstep, a more precise measurement might be more important than an update for each fullstep because the mechanical load never changes instantaneously from one step t o the next. for these applications, the sfilt bit enables a filtering function over four load measurements . the filter should always be enabled when high - precision measurement is required. it compensates for variations in motor construction, for example du e to misalignment of the phase a to phase b magnets. the filter should only be disabled when rapid response to increasing load is required, such as for stall detection at high velocity. 10.3 detecting a motor stall for best stall detection, work without stallg uard filtering ( sfilt =0). to safely detect a motor stall the stall threshold must be determined using a specific sgt setting. therefore, the maximum load needs to be determined, which the motor can drive without stalling . at the same time, monitor the sg v alue at this load, e.g. some value within the range 0 to 100. the stall threshold should be a value safely within the operating limits, to allow for parameter stray. the response at an sgt setting at or near 0 gives some idea on the quality of the signal: check the sg value without load and with maximum load. they should show a difference of at least 100 or a few 100, which shall be large compared to the offset. if you set the sgt value in a way, that a reading of 0 occurs at maximum motor load, the stall c an be automatically detected by the motion controller to issue a motor stop. in the moment of the step resulting in a step loss, the lowest reading will be visible. after the step loss, the motor will vibrate and show a higher sg reading. 10.4 homing with stall guard the homing of a linear drive requires moving the motor into the direction of a hard stop. as stallguard needs a certain velocity to work, make sure that the start point is far enough away from the hard stop to provide the distance required for the ac celeration phase. after setting up sgt and the ramp generator registers, start a motion into the direction of the hard stop and activate the stop on stall function as soon as the target velocity has been reached (set sg_stop in sw_mode ). once a stall is de tected, the ramp generator stops motion and sets v actual zero, stopping the motor. the stop condition also is indicated by the flag stallguard in drv_status . after setting up new motion parameters in order to prevent the motor from restarting right away, s tallguard can be disabled, or the motor can be re - enabled by reading ramp_stat . the read and clear function of the event_stop_sg flag in ramp_stat would restart the motor after t zerowait in case the motion parameters have not been modified. 10.5 limits of stal lguard2 operation stallguard2 does not operate reliably at extreme motor velocities: very low motor velocities (for many motors, less than one revolution per second) generate a low back emf and make the measurement unstable and dependent on environment con ditions (temperature, etc.). the automatic tuning procedure described above will compensate for this. other conditions will also lead to extreme settings of sgt and poor response of the measurement value sg to the motor load. very high motor velocities, i n which the full sinusoidal current is not driven into the motor coils also leads to poor response. these velocities are typically characterized by the motor back emf reaching the supply voltage.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 54 www.trinamic.com 11 coolstep operation coolstep is an automatic smart energy op timization for stepper motors based on the motor mechanical load, making them green. 11.1 user benefits coolstep allows substantial energy savings, especially for motors which see varying loads or operate at a high duty cycle. because a stepper motor application needs to work with a torque reserve of 30% to 5 0%, even a constant - load application allows significant energy savings because coolstep automatically enables torque reserve when required. reducing power consumption keeps the system cooler, increases motor life, and allows reducing cost in the power supp ly and cooling components. reducing motor current by half results in reducing power by a factor of four. 11.2 setting up for coolstep coolstep is controlled by several parameters, but two are critical for understanding how it works: parameter descriptio n range comment semin 4 - bit unsigned integer that sets a lower threshold . if sg goes below this threshold, coolstep increases the current to both coils. the 4 - bit semin value is scaled by 32 to cover the lower half of the range of the 10 - bit sg value. (th e name of this parameter is derived from smartenergy, which is an earlier name for coolstep.) 0 disable coolstep 115 semin *32 semax 4 - bit unsigned integer that controls an upper threshold . if sg is sampled equal to or above this threshold enough times, coolstep decreases the current to both coils. the upper threshold is ( semin + semax + 1)*32. 015 semin + semax +1)*32 f igure 11 . 1 shows t he operating regions of coolstep : - the black li ne represents the sg measurement value. - t he blue line represents the mecha nical load applied to the motor. - the red line represents the current into the motor coils. when the load increases, sg falls below semin , and coolstep increases the current. when the load decreases, sg rises above ( semin + semax + 1) * 32, and the current is reduced. energy efficiency C motor generates less heat C less cooling infrastructure C cheaper motor C
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 55 www.trinamic.com f igure 11 . 1 coolstep adapts motor current to the load five more parameters control cools tep and one status value is returned: parameter description range comment seup sets the current increment step . the current becomes incremented for each measured stallguard2 value below the lower threshold. 03 sedn sets the nu mber of stallguard 2 readings above the upper threshold necessary for each current decrement of the motor current. 03 seimin sets the lower motor current limit for coolstep operation by scaling the irun current setting. 0 0: 1/2 of irun 1 1: 1/4 of irun vcool thrs lower ramp generator velocity threshold. below this vel ocity coolstep becomes disabled. adapt to the lower limit of the velocity range where stallguard2 gives a stable result. hint: may be adapted to disable coolstep during acceleration and deceleration phase by setting identical to vmax . 1 vhigh upper ramp generator velocity threshold value. above this velocity coolstep becomes disabled. adapt to the velocity range wher e stallguard2 gives a stable result. 1 status word description range comment csactual this status value provides the actual motor current scale as controlled by coolstep. the value goes up to the irun value and down to the portion of irun as specified by seimin . 031 1/32, 2/32, 32/32 s t a l l g u a r d 2 r e a d i n g 0 = m a x i m u m l o a d m o t o r c u r r e n t i n c r e m e n t a r e a m o t o r c u r r e n t r e d u c t i o n a r e a s t a l l p o s s i b l e s e m i n s e m a x + s e m i n + 1 z e i t m o t o r c u r r e n t c u r r e n t s e t t i n g i _ r u n ( u p p e r l i m i t ) ? o r ? i _ r u n ( l o w e r l i m i t ) m e c h a n i c a l l o a d c u r r e n t i n c r e m e n t d u e t o i n c r e a s e d l o a d s l o w c u r r e n t r e d u c t i o n d u e t o r e d u c e d m o t o r l o a d l o a d a n g l e o p t i m i z e d l o a d a n g l e o p t i m i z e d l o a d a n g l e o p t i m i z e d
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 56 www.trinamic.com 11.3 tuning coolstep before tuning coolstep, first tune the stallguard2 threshold level sgt , which affects the range of the load measurement value sg . coolstep uses sg to operate the motor near the optimum load angle of +90. the current increment speed is specified in seup , and the current decrement speed is specified in sedn . they can be tuned separately because they are triggered by different events that may need different responses. the encodings for these parameters allow the coil currents to be increased much more quickly than decreased, because crossing the lower threshold is a more serious event that may require a faster response. if the respons e is too slow, the motor may stall. in contrast, a slow response to crossing the upper threshold does not risk anything more serious than missing an opportunity to save power. coolstep operates between limits controlled by the current scale parameter irun and the seimin bit. 11.3.1 response time for fast response to increasing motor load, use a high current increment step seup . if the motor load changes slowly, a lower current increment step can be used to avoid motor oscillations. if the filter controlled by sf ilt is enabled, the measurement rate and regulation speed are cut by a factor of four. hint the most common and most beneficial use is to adapt coolstep for operation at the typical system target operation velocity and to set the velocity thresholds accor ding. as acceleration and decelerations normally shall be quick, they will require the full motor current, while they have only a small contribution to overall power consumption due to their short duration. 11.3.2 low velocity and s tandby o peration because cools tep is not able to measure the motor load in standstill and at very low rpm, a lower velocity threshold is provided in the ramp generator. it should be set to an application specific default value. below this threshold the normal current setting via irun r espectively ihold is valid. an upper threshold is provided by the vhigh setting. both thresholds can be set as a result of the stallguard2 tuning process.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 57 www.trinamic.com 12 sine - wave look - up table each of the tmc 5031 drivers provides a programmable look - up table for stor ing the microstep current wave. as a default, the tables are pre - programmed with a sine wave, which is a good starting point for most stepper motors. reprogramming the table to a motor specific wave allows drastically improved microstepping especially with low - cost motors. 12.1 user benefits 12.2 microstep table in order to minimize required memory and the amount of data to be programmed, only a quarter of the wave becomes stored. the internal microstep table maps the microstep wave from 0 to 90 . it becomes symmetr ically extended t o 360 . when reading out the table the 10 - bit microstep counter mscnt addresses th e fully extended wave table . the table is stored in an incremental fashion, using each one bit per entry. therefore only 256 bits ( ofs00 to ofs255 ) are required to store the quarter wave. these bits are mapped to eight 32 bit registers. each ofs bit contro ls the addition of an inclination w x or w x +1 when advancing one step in the table . when wx is 0, a 1 bit in the table at the actual microstep position means add one when advancing to the next microstep. as the wave can have a high er inclination than 1, t he base inclinations wx can be programmed to - 1, 0, 1, or 2 using up to four flexible programmable segments within the quarter wave. this way even negative inclination can be realized. the four inclination segments are controlled by the position registers x 1 to x3 . inclination segment 0 goes from microstep position 0 to x1 - 1 and its base inclination is controlled by w0 , segment 1 goes from x1 to x2 - 1 with its base inclination controlled by w1 , etc. when modifyi ng the wave, care must be taken to ensure a s mooth and symmetrical zero transition when the quarter wave becomes expanded to a full wave . the maximum resulting swing of the wave should be adjusted to a range of - 248 to 248 , in order to give the best possible resolution while leaving headroom for the hysteresis based chopper to add an offset. f igure 12 . 1 lut programming example microstepping C motor C torque C m s c n t y 2 5 6 2 5 6 2 4 8 - 2 4 8 5 1 2 7 6 8 0 0 x 1 x 3 x 2 w 0 : + 2 / + 3 w 1 : + 1 / + 2 w 2 : + 0 / + 1 w 3 : - 1 / + 0 l u t s t o r e s e n t r i e s 0 t o 2 5 5 2 5 5 s t a r t _ s i n s t a r t _ s i n 9 0 _ 1 2 0
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 58 www.trinamic.com when the microstep sequencer advances within the table, it calculates the actual current values for the motor coils with each microstep and stores them to the registers cur_a and cur_b . however the incremental coding requires an absolute initialization, especially when the microstep table becomes modified. therefore cur_a and cur_b become initialized whenever mscnt passes zero. two registers control the starting values of the tables: - as the starting value at zero is not necessarily 0 (it might be 1 or 2), it can be programmed into the starting point register start_sin . - in the same way, the start of the second wave for the second motor coil needs to be stored in start_sin90_120 . this register stores the resulting table entry for a phase shift of 90 for 2 - phase stepper motor s . hint refer chapter 5.3 for th e register set and for the default table function stored in the drivers. the default table is a good base for realizing an own table. the tmc 5031 - eval come x with a calculation tool for own waves. initialization e xample for the default microstep table: ms lutx[0] = % 101010101010101 01011010101010100 = 0xaaaab554 mslutx[1] = % 010010101001010 10101010010101010 = 0x4a9554aa mslutx[ 2 ] = % 00100100010010010010100100101001 = 0x24492929 mslutx[ 3 ] = % 00010000000100000100001000100010 = 0x10104222 mslutx[ 4 ] = % 1111101111111 1 111111111111111111 = 0xfbffffff mslutx[ 5 ] = % 10110101101110110111011101111101 = 0xb5bb777d mslutx[ 6 ] = % 01001001001010010101010101010110 = 0x49295556 mslutx[ 7 ] = % 00000000010000000100001000100010 = 0x 00 404222 mslutselx = 0xffff8056: x1 = 128 , x2 =255 , x3 = 255 w3 = %01, w2 =%01, w1 =%01, w0 =%10 mslutstartx = 0x00 f 70000 : start_sin_0 = 0, start_sin90_120 = 247
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 59 www.trinamic.com 13 quick configuration guide this guide is meant as a practical tool to come to a first configuration and do a minimum set of measurements and decisions for tuning th e driver. it does not cover all advanced functionalities, but concentrates on the basic function set to make a motor run smoothly. once the motor runs, you may decide to explore additional features, e.g. freewheeling and further functionality in more detai l. a current probe on one motor coil is a good aid to find the best settings, but it is not a must. c urrent s etting and s etting up spread c ycle figure 13 . 1 current setting and s etting up spreadcycle c u r r e n t s e t t i n g c h o p c o n f s e t v s e n s e f o r m a x . 1 8 0 m v a t s e n s e r e s i s t o r ( 0 r 1 5 : 1 . 1 a p e a k ) s e t i _ r u n a s d e s i r e d u p t o 3 1 , i _ h o l d 7 0 % o f i _ r u n o r l o w e r l o w c u r r e n t r a n g e ? n y s e t i _ h o l d _ d e l a y t o 1 t o 1 5 f o r s m o o t h s t a n d s t i l l c u r r e n t d e c a y s e t t _ z e r o w a i t u p t o 6 5 5 3 5 f o r d e l a y e d s t a n d s t i l l c u r r e n t r e d u c t i o n c o n f i g u r e c h o p p e r t o t e s t c u r r e n t s e t t i n g s c h e c k h a r d w a r e s e t u p a n d m o t o r r m s c u r r e n t s p r e a d c y c l e c o n f i g u r a t i o n c h o p c o n f e n a b l e c h o p p e r u s i n g b a s i c c o n f i g . : t o f f = 5 , t b l = 2 , h s t a r t = 0 , h e n d = 0 m o v e t h e m o t o r b y s l o w l y a c c e l e r a t i n g f r o m 0 t o v m a x o p e r a t i o n v e l o c i t y m o n i t o r s i n e w a v e m o t o r c o i l c u r r e n t s w i t h c u r r e n t p r o b e a t l o w v e l o c i t y c h o p c o n f i n c r e a s e h e n d ( m a x . 1 5 ) c u r r e n t z e r o c r o s s i n g s m o o t h ? n m o v e m o t o r v e r y s l o w l y o r t r y a t s t a n d s t i l l c h o p c o n f s e t t o f f = 4 ( m i n . 3 ) , t r y l o w e r / h i g h e r t b l o r r e d u c e m o t o r c u r r e n t a u d i b l e c h o p p e r n o i s e ? y y m o v e m o t o r a t m e d i u m v e l o c i t y o r u p t o m a x . v e l o c i t y a u d i b l e c h o p p e r n o i s e ? c h o p c o n f d e c r e a s e h e n d a n d i n c r e a s e h s t a r t ( m a x . 7 ) y f i n i s h e d o r e n a b l e c o o l s t e p
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 60 www.trinamic.com m oving the m otor u sing the m otion c ontroller figure 13 . 2 moving the motor using the motion controller r a m p m o d e s e t v e l o c i t y _ p o s i t i v e s e t a m a x = 1 0 0 0 , s e t v m a x = 1 0 0 0 0 0 o r d i f f e r e n t v a l u e s m o t o r m o v e s , c h a n g e v m a x a s d e s i r e d m o v e m o t o r c o n f i g u r e r a m p p a r a m e t e r s r a m p m o d e s e t p o s i t i o n s t a r t v e l o c i t y s e t v s t a r t = 1 . h i g h e r v e l c o i t y f o r a b r u p t s t a r t ( l i m i t e d b y m o t o r ) . s t o p v e l o c i t y s e t v s t o p = 2 , b u t n o t b e l o w v s t a r t . h i g h e r v e l o c i t y f o r a b r u p t s t o p . c o n f i g u r e r a m p p a r a m e t e r s m o v e t o t a r g e t s e t x t a r g e t n e w o n - t h e - f l y t a r g e t ? * y e v e n t _ p o s _ r e a c h e d a c t i v e ? n n y t a r g e t i s r e a c h e d c h a n g e o f a n y p a r a m e t e r d e s i r e d ? n s e t m o t i o n p a r a m e t e r a s d e s i r e d y s e t a c c e l e r a t i o n a 1 a s d e s i r e d b y a p p l i c a t i o n d e t e r m i n e v e l o c i t y , w h e r e m a x . m o t o r t o r q u e o r c u r r e n t s i n k s a p p r e c i a b l y , w r i t e t o v 1 a m a x : s e t l o w e r a c c e l e r a t i o n t h a n a 1 t o a l l o w m o t o r t o a c c e l e r a t e u p t o v m a x s e t d e s i r e d m a x i m u m v e l o c i t y t o v m a x d m a x : u s e s a m e v a l u e a s a m a x o r h i g h e r d 1 : u s e s a m e v a l u e a s a 1 o r h i g h e r r e a d y t o m o v e t o t a r g e t * ) f o r o n - t h e - f l y t a r g e t c h a n g e , s e t v s t o p = 2 , v s t a r t = 1 a n d t z e r o w a i t = 0 . p l e a s e a l s o r e f e r r a m p g e n e r a t o r r e s t r i c t i o n s .
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 61 www.trinamic.com e nabling cool s tep ( in c ombination with spre ad c ycl e ) figure 13 . 3 enabling coolstep (in combination with spreadcycle) e n a b l e c o o l s t e p m o v e t h e m o t o r b y s l o w l y a c c e l e r a t i n g f r o m 0 t o v m a x o p e r a t i o n v e l o c i t y d o e s s g _ r e s u l t g o d o w n t o 0 w i t h l o a d ? m o n i t o r s g _ r e s u l t v a l u e d u r i n g m e d i u m v e l o c i t y a n d c h e c k r e s p o n s e w i t h m e c h a n i c a l l o a d i s c o i l c u r r e n t s i n e - s h a p e d a t v m a x ? d e c r e a s e v m a x n y i n c r e a s e s g t y c o o l c o n f e n a b l e c o o l s t e p b a s i c c o n f i g . : s e m i n = 1 , a l l o t h e r 0 n s e t v h i g h f o r u p p e r c o o l s t e p v e l o c i t y l i m i t s e t v c o o l t h r s t o t h e l o w e r v e l o c i t y l i m i t f o r c o o l s t e p m o n i t o r c s _ a c t u a l d u r i n g m o t i o n i n v e l o c i t y r a n g e a n d c h e c k r e s p o n s e w i t h m e c h a n i c a l l o a d d o e s c s _ a c t u a l r e a c h i r u n w i t h l o a d b e f o r e m o t o r s t a l l ? i n c r e a s e s e m i n o r c h o o s e n a r r o w e r v e l o c i t y l i m i t s n c 2 c 2 m o n i t o r c s _ a c t u a l a n d m o t o r t o r q u e d u r i n g r a p i d m e c h a n i c a l l o a d i n c r e m e n t w i t h i n a p p l i c a t i o n l i m i t s d o e s c s _ a c t u a l r e a c h i r u n w i t h l o a d b e f o r e m o t o r s t a l l ? i n c r e a s e s e u p n f i n i s h e d
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 62 www.trinamic.com 14 getting started please refer to the TMC5031 evaluation board to allow a quick start with the device, and in ord er to allow interactive tuning of the device setup in your application. chapter 13 will guide you through the process of correctly setting up all registers. 14.1 initialization examples initialization spi datagram example sequence to enable and initialize driver 1 and ramp generator 1 to move the motor in velocity mode and read access the position register : spi send: 0x8000000008; // gconf=8: enable pp and int outputs spi send: 0xec00010 0c 5; // chopconf: toff=5, hstrt=4, hend= 1 , tbl=2, chm=0 (spreadcycle) spi send: 0xb000011f05; // ihold_irun: ihold=5, irun=31 (max. current), iholddelay=1 spi send: 0xa600001388; // amax=5000 spi send: 0xa700004e20; // vmax=20000 spi send: 0xa000000001; // rampmode=1 (positive velocity) // now motor 1 should start rotating spi send: 0x2100000000; // query x actual C the next read access delivers x actual spi read; // read x actual initialization spi datagram example sequence to enable and initialize the motion controller and then move one rotation (51200 microsteps) using the ramp generator. spi send: 0xa4000003e8; // a1 = 1 000 first acceleration spi send: 0xa50000c350; // v1 = 50 000 acceleration threshold velocity v1 spi send: 0xa6000001f4; // amax = 500 acceleration above v 1 spi send: 0xa7000304d0; // vmax = 200 000 spi send: 0xa8000002bc; // dmax = 700 deceleration above v1 spi send: 0xaa00000578; // d1 = 1400 deceleration below v1 spi send: 0xab0000000a; // vstop = 10 stop velocity (near to zero) spi send: 0xa00000000 0 ; // rampmode = 0 (target position move) // ready to move! spi send: 0xadffff3800; // xtarget = - 51200 (move one rotation left (200*256 microsteps) ) hint tune the configuration parameters for your motor and application for optimum performance.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 63 www.trinamic.com 15 clock oscillator and clock input the clock is the tim ing reference for all functions: the chopper, the velocity , the acceleration control, etc. many parameters are scaled with the clock frequency, thus a precise reference allows a more deterministic result. the on - chip clock oscillator provides timing in case no external clock is easily available. 15.1 using the internal clock directly tie the clk input to gnd near to the tmc 5031 if the internal clock oscillator is to be used. t he internal clock can be calibrated b y driving the ramp generator at a certain velocity setting. reading out position values via the interface and comparing the resulting velocity to the remote masters clock gives a time reference. this allows scaling acceleration and velocity settings as a result. the temperature dependency and ageing of the internal clock is comparatively low. i mplementing f requency d ependent s caling frequency dependent scaling allows using the internal clock for a motion control application. the time reference of the exte rnal microcontroller is used to calculate a scaler for all velocity settings. the following steps are required: 1. you may leave the motor driver disabled during the calibration. 2. start motor in velocity mode, with vmax =10000 and amax =60000 ( for quick acceler ation). the acceleration phase is ended after a few ms. 3. read out xactual twice, at time point t1 and time point t2, e.g. 100ms later (dt=0.1s). the time difference between both read accesses shall be exactly timed by the external microcontroller. 4. stop the motion ramp by setting vmax =0. 5. the number of steps done in between of t1 and t2 now can be used to calculate the factor ? = ???? ? ?? ??????? ( ? 2 ) ? ??????? ( ? 1 ) = 1000 ??????? ( ? 2 ) ? ??????? ( ? 1 ) 6. now multiply each velocity value with this factor f, to normalize the velocity to steps per second. at a nominal value of the internal clock frequency, 780 steps will be done in 100ms. hint in case well defined velocity settings and precise motor chopper operation are desired, it is supposed to work with an external clock source. 15.2 using an external clock when an external clock is available, a frequency of 12 mhz to 16 mhz is recommended for optimum performance. the duty cycle of the clock signal is uncritical, as long as minimum high or low input time for the pin is satisfied (refer to electrical characteristics). up to 18 mhz can be used, when the clock duty cycle is 50%. make sure, that the clock source supplies clean cmos output logic levels and steep slopes when using a high clock frequency. the external clock input is enabled with the first positive polarity seen on the clk input. attention switching of f the external clock frequency prevents the driver from operating normally. therefore be careful to switch off the motor drivers before switching off the clock (e.g. using the enable input), because otherwise the chopper would stop and the motor current le vel could rise uncontrolled. the short to gnd detection stays active even without clock, if enabled. 15.3 considerations on the frequency a higher frequency allows faster step rates, faster spi operation and higher chopper frequencies. on the other hand, it m ay cause more electromagnetic emission of the system and causes more power dissipation in the tmc 5031 digital core and voltage regulator. generally a frequency of 1 0 mhz to 16
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 64 www.trinamic.com mhz should be sufficient for most applications. for reduced requirements concerning the motor dynamics, a clock frequency of down to 8 mhz can be considered.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 65 www.trinamic.com 16 absolute maximum ratings the maximum ratings may not be exceeded under any circumstanc es. operating the circuit at or near more than one maximum rating at a time for extended periods shall be avoided by application design. parameter symbol min max unit supply voltage v vs - 0.5 1 8 v i/o supply voltage v vio - 0.5 5.5 v digital vcc supply vo ltage (if not supplied by internal regulator) v vcc - 0.5 5.5 v logic input voltage v i - 0.5 v vio +0.5 v maximum current to / from digital pins and analog low voltage i/os i io +/ - 10 ma 5v regulator output current (internal plus external load) i 5vout 50 m a 5v regulator continuous power dissipation (v vm - 5v) * i 5vout p 5vout 1 w power bri dge repetitive output current i ox 2.0 a junction temperature t j - 50 150 c storage temperature t stg - 55 150 c esd - protection for interface pins (human body model, hbm ) v esdap 4 (tbd.) kv esd - protection for handling (human body model, hbm) v esd 1 (tbd.) kv 17 electrical characteristics 17.1 operational range parameter symbol min max unit junction temperature t j - 40 125 c supply voltage (using internal +5v regulator) v vs 5.5 1 6 v supply voltage (internal +5v regulator bridged: v vcc =v vsa ) v vs 4.7 5.4 v i/o supply voltage v vio 3.00 5.25 v vcc voltage when using optional external source (supplies digital logic and charge pump) v vcc 4.75 5.25 v rms motor coil current per coil (value for design guideline) i rms 0.8 a peak output current per motor coil output (sine wave peak) i ox 1.1 a peak output current per motor coil output (sine wave peak) limit t j 105c , e.g. for 100ms short time acceleration phase below 50% duty cycle. i ox 1. 5 a
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 66 www.trinamic.com 17.2 dc characteristics and timing characteristics dc characteristics contain the spread of values guaranteed within the specified supply voltage range unless otherwise s pecified. typical values represent the average value of all parts measured at +25c. temperature variation also causes stray to some values. a device with typical values will not leave min/max range within the full temperature range. power supply current dc - characteristics v vs = 16 .0v parameter symbol conditions min typ max unit supply current, driver disabled i vs f clk =16mhz 30 40 ma supply current, operating i vs f clk =16mhz, 40khz chopper 33 ma static supply current i vs0 f clk =0hz 7 ma supply curr ent, driver disabled, dependency on clk frequency i vs x f clk variable, additional to i vs0 1.6 ma/mhz internal current consumption from 5v supply on vcc pin i vcc f clk =16mhz, 40khz chopper 30 40 ma io supply current i vio no load on outputs, inputs at v i o or gnd 10 a motor driver section dc - and timing - characteristics v vs = 16 .0v parameter symbol conditions min typ max unit rds on lowside mosfet r onl measure at 100ma, 25c, static state 0.4 0.5 ? on highside mosfet r onh measure at 100ma, 25c, static state 0.5 0.6 ? slpon measured at 700ma load current 120 250 ns slope, mosfet turning off t slpoff measured at 700ma load current 220 450 ns current sourcing, drive r off i oidle o xx pulled to gnd 120 180 250 a charge pump dc - characteristics parameter symbol conditions min typ max unit charge pump output voltage v vcp - v vs operating, typical f chop <40khz 4.0 v 5vout - 0.4 v 5vout v charge pump voltage threshold for und ervoltage detection v vcp - v vs using internal 5v regulator voltage 3.1 3.6 3.9 v charge pump frequency f cp 1/16 f clkosc linear regulator dc - characteristics parameter symbol conditions min typ max unit output voltage v 5vout i 5vout = 0ma t j = 25c 4. 75 5.0 5.25 v output resistance r 5vout static load 3 ? 5vout(dev) i 5vout = 30ma t j = full range 30 100 mv
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 67 www.trinamic.com clock oscillator and input timing - characteristics parameter symbol conditions mi n typ max unit clock oscillator frequency f clkosc t j = - 50c 8.8 12.4 17.9 mhz clock oscillator frequency f clkosc t j =50c 9.4 13.2 18.8 mhz clock oscillator frequency f clkosc t j =150c 9.6 13.4 18.9 mhz external clock frequency (operating) f clk 8 12 - 16 1 8 mhz external clock high / low level time t clk l / t clk h clk driven to 0.1 v vio / 0.9 v vio 25 ns detector levels dc - characteristics parameter symbol conditions min typ max unit v vs a undervoltage threshold for reset v uv _vsa v vs a rising 3.8 4.2 4.6 v v 5vout undervoltage threshold for reset v uv _5vout v 5vout rising 3.5 v short to gnd detector threshold (v vsp - v ox ) v os2g 1.5 2.2 3 v short to gnd detector delay (high side switch on to short detected) t s2g high side output clamped to v sp - 3v 0.8 1.3 2 s ov ertemperature prewarning t otpw temperature rising 100 120 140 c overtemperature shutdown t ot temperature rising 135 150 170 c sense resistor voltage levels dc - characteristics parameter symbol conditions min typ max unit sense input peak threshold vo ltage (low sensitivity) v srtl vsense =0 csactual =31 sin_x =248 hyst.=0; i brxy =0 320 mv sense input peak threshold voltage (high sensitivity) v srth vsense =1 csactual =31 sin_x =248 hyst.=0; i brxy =0 180 mv sense input tolerance / motor current full scale t olerance i coil vsense =0 - 5 +5 % internal resistance from pin brxy to internal sense comparator (additional to sense resistor) r brxy 20 m? digital logic levels dc - characteristics parameter symbol conditions min typ max unit input voltage low level v inlo - 0.3 0.3 v vio v input voltage high level v inhi 0.7 v vio v vio +0.3 v input schmitt trigger hysteresis v inhyst 0.12 v vio v outp ut voltage low level v outlo i outlo = 2ma 0.2 v output voltage high level v outhi i outhi = - 2ma v vio - 0.2 v input leakage current i ileak - 10 10 a digital pin capacitance c 3.5 pf
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 68 www.trinamic.com 17.3 thermal characteristics the following table shall give an idea on the thermal resistance of the qf n - 48 package. the thermal resistance for a four layer board will provide a good idea on a typical application. the single layer board example is kind of a worst case condition, as the typical application will require a 4 layer board. actual thermal charact eristics will depend on the pcb layout, pcb type and pcb size. a thermal resistance of 23c/w for a typical board means, that the package is capable of continuously dissipating 4w at an ambient temperature of 25c with the die temperature staying below 12 5c. parameter symbol conditions typ unit typical power dissipation one motor active, one motor in standby at low current p d one motor 1.00a rms 112c (120c) one motor 0.71a rms 83c (90c) surface temperature at package center (peak surface temperatur e), board 55mm x 85mm, 25c environment stealthchop or spreadcycle, s inewave, 20khz chopper, 16 v , 16mhz , internal supply for vcc motors: qsh4218 - 035 - 10 - 027 3.5 2.3 w w typical power dissipation two motors active p d two motors 0.71a rms 110c (114c) two motors 0.35a rms 64c (65c) 3.5 1.3 w w thermal resistance junction to ambient on a single layer board r tja single signal layer board (1s) as defined in jedec eia jesd51 - 3 (fr4, 76.2mm x 114.3mm, d=1.6mm) 80 k/w thermal resistance junction to ambient on a multilayer board r tmja dual signal and two internal power plane board (2s2p) as defined in jedec eia jesd51 - 5 and jesd51 - 7 (fr4, 76.2mm x 114.3mm, d=1.6mm) 23 k/w thermal resistance junction to ambient on a multilayer board with air flow r tmja1 iden tical to r tmja , but with air flow 1m/s 20 k/w thermal resistance junction to board r tjb pcb temperature measured within 1mm distance to the package 10 k/w thermal resistance junction to case r tjc junction temperature to heat slug of package 3 k/w the t hermal resistance in an actual layout can be tested by checking for the heat up caused by the standby power consumption of the chip. when no motor is attached, all power seen on the power supply is dissipated within the chip. note: a spread - sheet for calc ulating TMC5031 power dissipation is available on www.trinamic.com.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 69 www.trinamic.com 18 layout considerations 18.1 exposed die pad the tmc 5031 uses its die attach pad to dissipate heat from the drivers and the linear regulator to the board. for best electrical and thermal perf ormance, use a reasonable amount of solid, thermally conducting vias between the die attach pad and the ground plane . the printed circuit board should have a solid ground plane spreading heat into the board and providing for a stable gnd reference. 18.2 wirin g gnd all signals of the TMC5031 are referenced to their respective gnd. directly connect all gnd pins under the TMC5031 to a common ground area (gnd, gndp, gnda and die attach pad). the gnd plane right below the die attach pad should be treated as a virtu al star point. for thermal reasons, the pcb top layer shall be connected to a large pcb gnd plane spreading heat within the pcb. attention especially, the sense resistors are susceptible to gnd differences and gnd ripple voltage, as the microstep current steps make up for voltages down to 0.5 mv. no current other than the sense resistor current should flow on their connections to gnd and to the tmc 5031 . optimally place them close to the tmc 5031 , with one or more vias to the gnd plane for each sense resistor. the two sense resistors for one coi l should not share a common ground connection trace or vias, as also pcb traces have a certain resistance. 18.3 supply filtering the 5vout output voltage ceramic filtering capacitor (4.7 f recommended) should be placed as close as possible to the 5vout pin, w ith its gnd return going directly to the gnda pin. use as short and as thick connections as possible. for best microstepping performance and lowest chopper noise an additional filtering capacitor can be used for the vcc pin to gnd, to avoid charge pump and digital part ripple influencing motor current regulation. therefore place a ceramic filtering capacitor (470nf recommended) as close as possible (1 - 2mm distance) to the vcc pin with gnd return going to the ground plane. vcc can be coupled to 5vout using a 2.2 ? resistor in order to supply the digital logic from 5vout while keeping ripple away from this pin. a 100 nf filtering capacitor should be placed as close as possible to the vsa pin to ground p lane. the motor supply pins vs should be decoupled with a n electrolytic capacitor (47 f or larger is recommended) and a ceramic capacitor, placed close to the device. take into account that the switching motor coil outputs have a high dv/dt. t hus capacitive stray into high resistive signals can occur, if the motor traces are near other traces over longer distances.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 70 www.trinamic.com 18.4 layout e xample schematic 1 - top l ayer (assembly side) 2 - inner l ayer (gnd) 3 - inner l ayer (supply vs) 4 - bottom l ayer c omponents f igure 18 . 1 layout example
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 71 www.trinamic.com 19 package mechanical data 19.1 dimensional drawing s attention: drawings not to scale. f igure 19 . 1 dimensional drawings p arameter ref min nom max total thickness a 0.80 0.85 0.90 st and off a1 0.00 0.035 0.05 mold thickness a2 - 0.65 0.67 lead frame thickness a3 0.203 lead width b 0.2 0.25 0.3 body size x d 7.0 body size y e 7.0 lead pitch e 0.5 exposed die pad size x j 5.2 5.3 5.4 exposed die pad size y k 5.2 5.3 5.4 lead length l 0.35 0.4 0.45 package edge tolerance aaa 0.1 mold flatness bbb 0.1 coplanarity ccc 0.08 lead offset ddd 0.1 exposed pad offset eee 0.1 19.2 package codes type package temperature range code & marking tmc 5031 qfn48 (rohs) - 40c ... +125c tmc 5031 - la
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 72 www.trinamic.com 20 disclaimer trinamic motion control gmbh & co. kg does not authorize or warrant any of its products for use in life support systems, without the specific written consent of trinamic motion control gmbh & co. kg. life support systems are equipment intended to support or sustain life, and whose failure to perform, when properly used in accordance with instructions provided, can be reasonably expected to result in personal injury or death. information given in this data sheet is believe d to be accurate and reliable. however no responsibility is assumed for the consequences of its use nor for any infringement of patents or other rights of third parties which may result from its use. specifications are subject to change without notice. all trademarks used are property of their respective owners. 21 esd sensitive device the tmc 5031 is an esd sensitive cmos device sensitive to electrostatic discharge. take special care to use adequate grounding of personnel and machines in manual handling. a fter soldering the devices to the board, esd requirements are more relaxed. failure to do so can result in defect or decreased reliability.
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 73 www.trinamic.com 22 table of f igures figure 1.1 basic application and blo ck diagram ................................ ................................ ................................ .......... 4 figure 1.2 energy efficiency with coolstep (example) ................................ ................................ ............................... 6 figure 2.1 TMC5031 pin assignments. ................................ ................................ ................................ ............................. 7 figure 3.1 standard application circuit ................................ ................................ ................................ ......................... 10 figure 3.2 external supply of vcc_io (showing optional filtering for vcc) ................................ ...................... 11 figure 3.3 5v only operation ................................ ................................ ................................ ................................ ........... 12 figure 3.4 using an external 5v supply to reduce linear regulator power dissipation ................................ . 13 figure 3.5 using an external 5v supply to bypass internal regulator ................................ ................................ 13 figure 3.6 adding an rc - filter on vcc for reduced ripple ................................ ................................ ..................... 14 figure 3.7 simple esd enhancement and more elaborate motor output protection ................................ .... 15 figure 4.1 spi timing ................................ ................................ ................................ ................................ ......................... 18 figure 7.1 chopper phases ................................ ................................ ................................ ................................ .............. 34 figure 7.2 no ledges in current wave with sufficient hysteresis (magenta: current a, yellow & blue: sense resistor voltages a and b) ................................ ................................ ................................ ................................ ... 36 figure 7.3 spreadcycle chopper scheme showing coil current during a chopper cycle ............................... 37 figure 7.4 classic const. off time chopper with offset showing co il current ................................ ................... 38 figure 7.5 zero crossing with classic chopper and correction using sine wave offset ................................ . 38 figure 9.1 ramp generator v elocity trace showing consequent move in negative direction ..................... 43 figure 9.2 illustration of optimized motor torque usage with TMC5031 ramp generator ........................... 44 figure 9.3 ramp generator velocity dependent motor control ................................ ................................ ............ 45 figure 9.4 using reference switches (example) ................................ ................................ ................................ ......... 46 figure 10.1 function principle of stallguard2 ................................ ................................ ................................ ............ 50 figure 10.2 example: optimum sgt setting and stallguard2 reading with an example motor ................. 52 figure 11.1 coolstep adapts motor current to the load ................................ ................................ ......................... 55 figure 12.1 lut programming example ................................ ................................ ................................ ....................... 57 figure 13.1 curr ent setting and setting up spreadcycle ................................ ................................ ......................... 59 figure 13.2 moving the motor using the motion controller ................................ ................................ ................. 60 figure 13.3 enabling cools tep (in combination with spreadcycle) ................................ ................................ ..... 61 figure 18.1 layout example ................................ ................................ ................................ ................................ ............. 70 figure 19.1 dimensional drawings ................................ ................................ ................................ ................................ 71
TMC5031 datasheet (rev. 1.11 / 2016 - apr - 28 ) 74 www.trinamic.com 23 revision history version date author bd C bernhard dwersteg sd C sonja dwersteg description 1.04 2012_nov - 1 8 bd / sd first version of product tmc 5031 datasheet based on tmc562 prototype datasheet v1.04 1.05 2013_feb - 22 jp product image cha nged 1.06 2013 - mar - 25 sd - chapter 17.3 (thermal characteristics) added. - chapter 10.1 (tuning the stallguard2 threshold) updated. - csactual in drv_status corrected (chapter 5.3.4 ) . - i nterrupt output remark in ramp_stat for status_latch_l and status_latch_r removed. description event_stop_l and event_stop_r updated (chapter 6.2.2.2 ) - description of the reference s witch actions improved. - sw_mode register updated. - order codes updated. - consecutive numbering of the document corrected. 1.07 2013 - apr - 30 sd new description of vcc_io requirements. 1.08 2014 - may - 12 sd - standard application circuit updated. - motor current calculation updated. 1.09 2014 - jul - 01 bd - integrated errata sheet v1.1 & workaround in 9.5 - order code C la updated 1.10 2015 - mar - 24 bd stallguard stop details: improved homing algorithm, added 1 0 .4, text for event_stop_sg, limits vcp uv , detail wording i n many chapters, 320mv vsrtl, spi example, explanation vactual sign, imp roved blue blocks, added quick c onfiguration g uide 1.11 2016 - apr - 28 bd corrected toff calculation example, comments in gstat, comment on spi_status, 5v only + - 5% , x1=128 in microstep table defaults , setting negative encoder factors, adaptation to internal fclk , interrupt handling , wording v1 and vmax register , esd schematic w. varistors instead of snubber t able 23 . 1 documentation revisions 24 references [an001] trinamic application note 001 - parameterization of spreadcycle? , www.trinamic.com [an002] trinamic application note 002 - parameterization of stallguard2? & coolstep? , www.trinamic.com calculation sheet tmc50xx_calculations.xlsx


▲Up To Search▲   

 
Price & Availability of TMC5031

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X